Bug 2116369

Summary: Unable to enable callback plugin per-template
Product: Red Hat Satellite Reporter: Pablo Mendez Hernandez <pmendezh>
Component: Ansible - Configuration ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: addubey
Severity: medium Docs Contact: Zuzana Lena Ansorgova <zuansorg>
Priority: medium    
Version: 6.10.0CC: addubey, ahumbe, ashipati, bangelic, jsenkyri, lstejska, nalfassi, oezr, pcreech, rlavi, tdamato, vdeshpan, zuansorg
Target Milestone: 6.14.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_ansible-11.2.0 Doc Type: Bug Fix
Doc Text:
.Enable Ansible callback per job template Ansible callback allows hosts to send facts, which are used to create configuration reports, back to Satellite after a job finishes. You can now enable the callback for Ansible job templates per template. By default, the callback is enabled only for the original `Ansible Roles - Ansible Default` template and disabled for all the other original Ansible job templates. To enable the callback, create, clone, or edit an unlocked Ansible job template, navigate to the *Ansible* tab and select the *Enable Ansible Callback* checkbox.
Story Points: ---
Clone Of:
: 2211954 (view as bug list) Environment:
Last Closed: 2023-11-08 14:18:01 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:

Description Pablo Mendez Hernandez 2022-08-08 12:02:45 UTC
Description of problem:

After the fix for https://bugzilla.redhat.com/show_bug.cgi?id=1934110 went in (in 6.10), it's not possible to upload reports to Satellite for cloned roles.

The option to set a cloned role in "Administer -> Remote Execution Features -> ansible_run_host" is not valid since only one role (cloned or not) would have that
"ability", so it would be better to add a flag to every job template to enable it
(that way it could be inherited or not when cloned).


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


How reproducible:

Always


Steps to Reproduce:
1. Clone: "Ansible Roles - Ansible Default" template [1]
2. Run: the new template
3. "WARNING: Callback disabled by environment. Disabling the Foreman callback plugin"


Actual results:

Foreman callback plugin is not enabled and report is not uploaded to Satellite.


Expected results:

Foreman callback plugin is enabled if set and report is uploaded to Satellite.


Additional info:

Comment 2 Ron Lavi 2022-09-14 13:44:12 UTC
*** Bug 2125391 has been marked as a duplicate of this bug. ***

Comment 3 nalfassi 2022-10-02 12:09:39 UTC
Created redmine issue https://projects.theforeman.org/issues/35585 from this bug

Comment 4 Bryan Kearney 2023-01-04 16:03:11 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35585 has been resolved.

Comment 5 nalfassi 2023-01-17 15:05:34 UTC
Details about the fix: 

A new option to enable the callback plugin for each template was added.

In the UI menu under Hosts -> Job Templates:
When you create a new job-template/edit an existing job-template - if the `Provider Type` (located in the `job` tab) is set to `Ansible`, a new `Ansible` tab should be displayed, with the new `Enable Ansible Callback` option. 
When the checkbox is checked - the callback is enabled for this job-template, and when the checkbox is unchecked - the callback is disabled. 

Note: If the job-template is locked, you won’t be able to edit the `Enable Ansible Callback` option.  

Hammer-cli update: 
When running the command `hammer job-template info –id=<tempalte_id>`, there should be a new boolean property: `Ansible Callback Enabled`. If the job-template’s provider is not set to `Ansible` - the new field won’t be displayed. 
You should also be able to use the `--ansible-callback-enabled` option when creating/updating job-templates. 

API update:
The new `ansible_callback_enabled` field should be included in the response of GET requests to show template details: `GET /api/job_templates/:id`.
You should also be able to send the `ansible_callback_enabled` parameter when creating/editing job-templates through an API call. 

Let me know if you need more information.

Comment 7 nalfassi 2023-03-06 09:22:02 UTC
*** Bug 2139448 has been marked as a duplicate of this bug. ***

Comment 17 errata-xmlrpc 2023-11-08 14:18:01 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 (Important: Satellite 6.14 security and bug fix update), 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-2023:6818