Bug 2139448

Summary: Host Config Reports are not created when ansible role(s) are called outside of 'Run all Ansible roles'
Product: Red Hat Satellite Reporter: Jan Senkyrik <jsenkyri>
Component: Ansible - Configuration ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: addubey
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: addubey, nalfassi, oezr, torkil
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-03-06 09:22:02 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 Jan Senkyrik 2022-11-02 15:13:49 UTC
Description of problem:

A new config report is created when you run all ansible roles on a particular host:

- WebUI --> Hosts --> All Hosts --> select hosts --> Select Action --> Run all Ansible roles.

However a new config report is *not* created when you run just a subset of roles. See reproducing steps.


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


How reproducible:
Always


Steps to Reproduce:

1. Create a job template/playbook that calls one role with fact gathering enabled:


- WebUI --> Hosts --> Job Templates --> run_only_one_role

---
- hosts: all
  gather_facts: yes
  pre_tasks:
    - name: Display all parameters known for the Foreman host
      debug:
        var: foreman
      tags:
        - always
  tasks:
    - name: Apply roles
      include_role:
        name: "RedHatInsights.insights-client"



2. Configure the job template:
~~~
Job Category: Ansible Playbook
Provider Type: Ansible
~~~


3. Run the playbook on a host:

- WebUI --> All Hosts --> select host --> Select Action --> Schedule Remote Job

~~~
Job Category: Ansible Playbook
Job Template: run_only_one_role
~~~

4. Verify gather_facts was executed successfully:

~~~
1:
[WARNING]: Callback disabled by environment. Disabling the Foreman callback
   2:
plugin.
   3:

   4:
PLAY [all] *********************************************************************
   5:

   6:
TASK [Gathering Facts] *********************************************************
   7:
ok: [jsenkyri-rhel8-sat611.sysmgmt.lan]
...
...
...
PLAY RECAP *********************************************************************
  95:
jsenkyri-rhel8-sat611.sysmgmt.lan : ok=9    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
  96:
Exit status: 0
~~~

5. Go to 'WebUI --> Hosts --> All Hosts' and check if 'Last report' column was updated.


Actual results:
'Last report' column was not updated.


Expected results:
'Last report' column should be updated because gather_facts module was executed.

Comment 1 nalfassi 2023-03-05 13:15:06 UTC
I believe this is a duplicate of Bug 2116369.
May I close it?

Comment 2 Jan Senkyrik 2023-03-06 08:42:51 UTC
Indeed, that looks like a match.

Feel free to close this BZ then, thanks.

Comment 3 nalfassi 2023-03-06 09:22:02 UTC

*** This bug has been marked as a duplicate of bug 2116369 ***