Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1465199 - [RFE] Enable removing override values from sc-params by specifying --match
Summary: [RFE] Enable removing override values from sc-params by specifying --match
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Smart Variables
Version: Unspecified
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-27 00:24 UTC by jalviso
Modified: 2022-03-13 14:19 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-28 19:34:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15003 0 Normal New Enable removing override values from sc-params by specifying --match 2021-02-10 09:48:36 UTC

Description jalviso 2017-06-27 00:24:21 UTC
Description of problem:

While it is possible to specify a match for an FQDN or Hostgroup using
"hammer sc-param", it is not possible to specify a match with removing sc-param;

Usage:
hammer sc-param add-override-value [OPTIONS]

Options:
--match MATCH Override match
--puppet-class PUPPET_CLASS_NAME Puppet class name
--puppet-class-id PUPPET_CLASS_ID ID of Puppet class
--smart-class-parameter SMART_CLASS_PARAMETER_NAME Smart class parameter name
--smart-class-parameter-id SMART_CLASS_PARAMETER_ID
--use-puppet-default USE_PUPPET_DEFAULT
--value VALUE Override value
-h, --help print help

hammer sc-param remove-override-value [OPTIONS]

Options:
--id ID
--puppet-class PUPPET_CLASS_NAME Puppet class name
--puppet-class-id PUPPET_CLASS_ID ID of Puppet class
--smart-class-parameter SMART_CLASS_PARAMETER_NAME Smart class parameter name
--smart-class-parameter-id SMART_CLASS_PARAMETER_ID
-h, --help print help 

Version-Release number of selected component (if applicable): 6.2+

How reproducible: Always

Steps to Reproduce:

1. Identify the smart class parameter id:

# hammer sc-param list
---|--------------------|-----------------------------------------------------|----------|-----------------------
ID | PARAMETER          | DEFAULT VALUE                                       | OVERRIDE | PUPPET CLASS          
---|--------------------|-----------------------------------------------------|----------|-----------------------
20 | template           | motd/motd.erb                                       | true     | motd   

# hammer sc-param remove-override-value --smart-class-parameter-id 20 --match fqdn=rhel7.gsslab.bne.redhat.com

Actual results:

# hammer sc-param remove-override-value --smart-class-parameter-id 20 --match fqdn=rhel7.gsslab.bne.redhat.com
Could not delete the override value:
  Error: Unrecognised option '--match'
  
  See: 'hammer sc-param remove-override-value --help'


Expected results:

The appropriate override should be removed by looking up the FQDN match but there is no available option  "--match MATCH Override match".

Additional info:

It would be useful to have the ability to remove an override via a matcher in the same way it can be added.

Comment 1 jalviso 2017-06-27 00:25:26 UTC
Upstream bugzilla exist with this same issue;

http://projects.theforeman.org/issues/15003
Can't remove a sc-param match using Hammer

Comment 2 Tomas Strachota 2017-06-27 11:32:21 UTC
Note that at the moment it's possible to use --id to specify which override value to remove:

> hammer sc-param remove-override-value -h
Usage:
    hammer sc-param remove-override-value [OPTIONS]

Options:
 --id ID                                              
 --puppet-class PUPPET_CLASS_NAME                    Puppet class name
 --puppet-class-id PUPPET_CLASS_ID                   ID of Puppet class
 --smart-class-parameter SMART_CLASS_PARAMETER_NAME  Smart class parameter name
 --smart-class-parameter-id SMART_CLASS_PARAMETER_ID  
 -h, --help                                          print help

> hammer sc-param remove-override-value --smart-class-parameter-id 53 --id 6
Override value deleted

Comment 3 jalviso 2017-06-28 04:49:54 UTC
Hi Tomas,

Thank you for your update.

Here is the customer's reason as to why --match option is useful than specifying --id:

+------------------------------------------------------------------------------+
To give you an idea of why that isn't a useful solution I'll outline what we're trying to achieve.
We use puppet to control who has sudo access on individual hosts. This requires we create a matcher against the fqdn of the host with the appropriate sudo rules as an override to our default set of rules. That works fine. The problem is, Foreman doesn't allow you to replace a fqdn match with a new one, you have to actually remove the match then read it, otherwise foreman throws an error that the match is already taken. Accurately determining which id applies to which match programmatically is very difficult, so its not practical to specify the match we want to remove via id. Instead we need to be able to specify the match via the fqdn of the host. At present we have to manually look at the output from hammer, find the id that matches up to the fqdn we're working with, manually remove it then readd the match. That's not sustainable going forward as we migrate more of our fleet to Satellite 6 and require more complicated and frequently changing sudo rules.
+------------------------------------------------------------------------------+

Regards,

Josephine

Comment 4 Tomas Strachota 2017-06-28 08:07:40 UTC
Thank you for additional info. This is valuable feedback.

As a support for the described workflow we could also add a '--force' option to 'add-override-value' command that would replace the value if the match is found.

Comment 7 Bryan Kearney 2019-02-07 12:09:20 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 8 Bryan Kearney 2019-02-28 19:34:59 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.


Note You need to log in before you can comment on or make changes to this bug.