Red Hat Bugzilla – Bug 1365820
Document "report" renamed to "config_report" for foreman hooks plugin (6.2 upgrade step)
Last modified: 2018-08-31 11:19 EDT
Description of problem: After upgrading to 6.2 report 'after_create' hook no longer running. Version-Release number of selected component (if applicable): tfm-rubygem-foreman_hooks-0.3.11-1.el7sat.noarch How reproducible: Always Steps to Reproduce: 1. Create /usr/share/foreman/config/hooks/report/after_create/10-test with the following content #!/bin/sh logger "Testing after_create hooks" exit 0 2. Use puppet to trigger the hook execution in a client: puppet agent -t --server satellite.example.com Actual results: The hook is not executed. Expected results: The hook to be executed. Additional info: In 6.2 Report class is changed into ConfigReport so the hooks are not looking into the script which is stored into report directory. So if you create /usr/share/foreman/config/hooks/config_report/after_create/10-test It works.
I'm marking this as a regression since this change made code working on previous versions unusable. This change is also undocumented, so there is no way that customers could ammend their hooks. I suspect that this is going to be a general issue, since many customers will be using their own scripts for after_create hooks.
Thanks, I confirm. This is good DOCO ERRATA candidate for specific 6.2 upgrade instructions.
Assigning to Stephen for review. Stephen - given the nature of this bug, one approach that comes to mind is to describe the issue in the doc text field and make this a known issue release note so that it is called out there. What do you think?
report(In reply to Andrew Dahms from comment #3) > Assigning to Stephen for review. > > Stephen - given the nature of this bug, one approach that comes to mind is > to describe the issue in the doc text field and make this a known issue > release note so that it is called out there. > > What do you think? Hello I agree, I think that is essential. I greped all the guides, I could not find "hooks/report", which suggests there is no example or procedure that needs correcting. I found `after_create` mentioned in "Rails Events" under "Using Foreman Hooks" in the Server Administration Guide[1] But if you scroll up and look at the end of "Procedure 10.1. Creating a Foreman Hook to Use the logger Command" you will see: This command output also lists some technical tables which are unlikely to be used with Foreman Hooks, for example "active_record" or "habtm". These are most commonly used: host report I think that is the "report" in question. [1] https://access.redhat.com/documentation/en/red-hat-satellite/6.2/paged/server-administration-guide/102-using-foreman-hooks#sect-Red_Hat_Satellite-Server_Administration_Guide-Red_Hat_Satellite_Foreman_Hooks_Rails_Events
(In reply to Stephen Wadeley from comment #5) > report(In reply to Andrew Dahms from comment #3) > > Assigning to Stephen for review. > > <snip> > > This command output also lists some technical tables which are unlikely to > be used with Foreman Hooks, for example "active_record" or "habtm". These > are most commonly used: > > host > report > > I think that is the "report" in question. > In my test VM for Sat6.2.1 I started foreman-rake console and entered: ActiveRecord::Base.descendants.collect(&:name).collect(&:underscore).sort in the output I see "config_report" and later just "report". So now I am unsure.
Hello lzap Can you read comment 5 and see if there is anything more I should add or change in the guide at the link provided? Is there someone else I should ask about this? Thank you
No this is right, make it an Upgrade note for 6.2 only. It's really only ConfigReport model that was renamed, nothing else AFAIK.
Thank you lzap I have added some text to the "Upgrading Satellite Server and Capsule Server" with title "Foreman Hooks' Report Class Renamed to ConfigReport"
Hello this change is now live on the customer portal https://access.redhat.com/documentation/en/red-hat-satellite/6.2/paged/installation-guide/chapter-6-upgrading-satellite-server-and-capsule-server