Bug 2039696

Summary: Puppet-related hammer commands still missing after plugin enabled
Product: Red Hat Satellite Reporter: Vladimír Sedmík <vsedmik>
Component: PuppetAssignee: Oleh Fedorenko <ofedoren>
Status: CLOSED ERRATA QA Contact: Vladimír Sedmík <vsedmik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: ofedoren, pcreech, rlavi
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-hammer_cli_foreman-3.1.0.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:31:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1809769    

Description Vladimír Sedmík 2022-01-12 09:11:55 UTC
Description of problem:
Puppet-related commands are still missing after the plugin was enabled.


Version-Release number of selected component (if applicable):
7.0 snap 3


How reproducible:
always


Steps to Reproduce:
1. Have a fresh Satellite
2. Enable puppet plugin:
# satellite-installer --enable-foreman-plugin-puppet \
--enable-foreman-cli-puppet \
--foreman-proxy-puppet true \
--foreman-proxy-puppetca true \
--foreman-proxy-content-puppet true \
--enable-puppet \
--puppet-server true \
--puppet-server-foreman-ssl-ca /etc/pki/katello/puppet/puppet_client_ca.crt \
--puppet-server-foreman-ssl-cert /etc/pki/katello/puppet/puppet_client.crt \
--puppet-server-foreman-ssl-key /etc/pki/katello/puppet/puppet_client.key
3. Try `hammer <cmd> --help` for one of these subcommands:
   puppet-environment
   puppet-class
   config-group
   host puppet-classes
   host sc-params
   hostgroup puppet-classes
   hostgroup sc-params


Actual results:
Error: No such sub-command 'puppet-environment'.


Expected results:
Subcommand was added and can be used.


Additional info:
Refreshing the hammer cache manually workarounds this issue: `hammer -r`

Comment 1 Bryan Kearney 2022-01-12 12:05:28 UTC
Upstream bug assigned to ofedoren

Comment 2 Bryan Kearney 2022-01-12 12:05:29 UTC
Upstream bug assigned to ofedoren

Comment 3 Marek Hulan 2022-01-13 13:22:43 UTC
I guess the CLI packages should somehow invalidate the hammer cache. Oleh, any pointers how other hammer plugins solve this or whether they do?

Comment 4 Oleh Fedorenko 2022-01-13 14:42:01 UTC
Marek, hammer plugins don't do any cache invalidation. IIUC, RPM installation of Foreman plugins has post step which will re-cache the API documentation for Foreman, thus changing its checksum. This checksum is used in apipie-bindings to determine whether the local hammer's cache should be updated or not. I've seen that it does reload the cache automatically, but sometimes (I guess more often) it doesn't.

The linked Redmine issue is more about to ensure we always reload the cache automatically, so there is no need to run hammer --reload-cache manually, which hopefully will solve such and similar issues described in this BZ.

Comment 6 Marek Hulan 2022-05-06 10:49:42 UTC
Does the `hammer --reload-cache` help? We'd either need to add that to the installer or rpm post script. Or document that step.

Comment 7 Vladimír Sedmík 2022-05-06 12:31:47 UTC
Yes, `hammer -r` helps.

Comment 8 Bryan Kearney 2022-05-09 16:04:35 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/28283 has been resolved.

Comment 10 Vladimír Sedmík 2022-05-19 08:32:55 UTC
Verified in 6.11.0 snap 20 (tfm-rubygem-hammer_cli_foreman-3.1.0.1-1.el7sat.noarch)

The commands get available after the plugin is enabled, just note there is some delay ~5-10 seconds after the installer finishes before the hammer cache is refreshed.

Comment 13 errata-xmlrpc 2022-07-05 14:31:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498