Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1365820 - Document "report" renamed to "config_report" for foreman hooks plugin (6.2 upgrade step)
Document "report" renamed to "config_report" for foreman hooks plugin (6.2 up...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Docs Install Guide (Show other bugs)
6.2.0
Unspecified Unspecified
high Severity high (vote)
: 6.2.3
: Unused
Assigned To: Stephen Wadeley
Brandi
: Regression
Depends On:
Blocks: GSS_Sat6Beta_Tracker/GSS_Sat6_Tracker
  Show dependency treegraph
 
Reported: 2016-08-10 05:40 EDT by Javier Ramirez
Modified: 2018-08-31 11 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
Rails events no longer triggering hooks in /hooks/report In Satellite 6.2 the Report class is changed to ConfigReport so the hooks are no longer looking for a script stored in the /hooks/report/ directory. Create a directory /usr/share/foreman/config/hooks/config_report/ and move hooks such as `after_create` and `before_create` to the new directory.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-26 02:23:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2491841 None None None 2016-08-10 05:46 EDT

  None (edit)
Description Javier Ramirez 2016-08-10 05:40:09 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.
Comment 1 Javier Ramirez 2016-08-10 05:46:16 EDT
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.
Comment 2 Lukas Zapletal 2016-08-11 04:18:16 EDT
Thanks, I confirm. This is good DOCO ERRATA candidate for specific 6.2 upgrade instructions.
Comment 3 Andrew Dahms 2016-09-12 21:16:51 EDT
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?
Comment 5 Stephen Wadeley 2016-09-13 06:52:08 EDT
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
Comment 6 Stephen Wadeley 2016-09-13 07:02:10 EDT
(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.
Comment 10 Stephen Wadeley 2016-09-15 05:12:12 EDT
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
Comment 11 Lukas Zapletal 2016-09-22 07:19:13 EDT
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.
Comment 12 Stephen Wadeley 2016-09-22 09:50:58 EDT
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"

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