Bug 2156532 - Misleading job invocation details when running ansible roles in bulk
Summary: Misleading job invocation details when running ansible roles in bulk
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible
Version: 6.12.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-27 10:44 UTC by Jan Senkyrik
Modified: 2023-05-03 15:33 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
job invocation details (176.65 KB, image/png)
2022-12-27 10:45 UTC, Jan Senkyrik
no flags Details
invocation_all_failed (106.00 KB, image/png)
2023-03-06 14:02 UTC, Jan Senkyrik
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36353 0 Normal New Misleading job invocation details when running ansible roles in bulk 2023-05-03 15:33:56 UTC

Description Jan Senkyrik 2022-12-27 10:44:30 UTC
Description of problem:
Roles assigned only to host_a show up in host_b job invocation details.

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

Let me explain it on a real example:
- Have 2 hosts - 'jsenkyri-rhel8' and 'jsenkyri-rhel7'
- Assign 'RedHatInsights.insights-client' role to 'jsenkyri-rhel8'
- Do *not* assign any roles to 'jsenkyri-rhel7'
- Select both hosts and hit 'Run all Ansible roles'
- Check job details for 'jsenkyri-rhel7'. Tasks related to 'RedHatInsights.insights-client' role are visible even though the role is *not* assigned to this host. See attached screenshot.

Actual results:
Role(s) assigned *only* to 'jsenkyri-rhel8' show-up in 'jsenkyri-rhel7' job invocation details.

Expected results:
Job invocation details for 'jsenkyri-rhel7' should only show roles/tasks that are assigned to this particular host.

Comment 1 Jan Senkyrik 2022-12-27 10:45:48 UTC
Created attachment 1934563 [details]
job invocation details

Comment 2 Jan Senkyrik 2023-03-06 14:01:54 UTC
One more behavior that might be related:

- Choose multiple hosts (e.g. host_a, host_b, host_c, host_d) and make host_a unreachable (e.g. shutdown).
- Run All Ansible roles for these 4 hosts.

Actual result:
- All 4 hosts are shown as failed (see attached screenshot)
- Check details for host_d and you can see that all tasks finished ok but the exit code is 4:

~~~
TASK [Apply roles] *************************************************************
 165:

 166:
TASK [RedHatInsights.insights-client : Install 'insights-client'] **************
 167:
ok: [jsenkyri-rhel8-sat612-d.sysmgmt.lan]
 168:

 169:
TASK [RedHatInsights.insights-client : Set Insights Configuration Values] ******
 170:
ok: [jsenkyri-rhel8-sat612-d.sysmgmt.lan]
 171:

 172:
TASK [RedHatInsights.insights-client : Register Insights Client] ***************
 173:
ok: [jsenkyri-rhel8-sat612-d.sysmgmt.lan]
 174:

 175:
TASK [RedHatInsights.insights-client : Change permissions of Insights Config directory so that Insights System ID can be read] ***
 176:
ok: [jsenkyri-rhel8-sat612-d.sysmgmt.lan]
 177:

 178:
TASK [RedHatInsights.insights-client : Change permissions of machine_id file so that Insights System ID can be read] ***
 179:
ok: [jsenkyri-rhel8-sat612-d.sysmgmt.lan]
 180:

 181:
TASK [RedHatInsights.insights-client : Create directory for ansible custom facts] ***
 182:
ok: [jsenkyri-rhel8-sat612-d.sysmgmt.lan]
 183:

 184:
TASK [RedHatInsights.insights-client : Install custom insights fact] ***********
 185:
ok: [jsenkyri-rhel8-sat612-d.sysmgmt.lan]
 186:

 187:
TASK [RedHatInsights.insights-client : Enable Insights timer] ******************
 188:
ok: [jsenkyri-rhel8-sat612-d.sysmgmt.lan]
 189:
PLAY RECAP *********************************************************************
 190:
jsenkyri-rhel8-sat612-d.sysmgmt.lan : ok=10   changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
 191:
Exit status: 4
~~~

Expected results:
- Only host_a is shown as failed. host_b, host_c and host_d should be marked as successful.

Comment 3 Jan Senkyrik 2023-03-06 14:02:49 UTC
Created attachment 1948364 [details]
invocation_all_failed

Comment 4 Jan Senkyrik 2023-03-06 14:10:18 UTC
Bug 2156522 is similar but I don't think it's an exact match.

Comment 5 nalfassi 2023-05-03 15:33:54 UTC
Created redmine issue https://projects.theforeman.org/issues/36353 from this bug


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