Bug 1809051 - ansible-runner is executing not assigned playbooks
Summary: ansible-runner is executing not assigned playbooks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.7.0
Assignee: satellite6-bugs
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-02 10:36 UTC by Stefan Meyer
Modified: 2020-04-14 13:29 UTC (History)
3 users (show)

Fixed In Version: tfm-rubygem-foreman_ansible-4.0.3.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:28:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 29261 0 Normal New ansible-runner is executing not assigned playbooks 2021-02-03 15:24:05 UTC
Github theforeman/foreman_ansible/commit/6af2c6b88acfef38a4d21a514a7972f1d9e7ac2c 0 None None None 2020-09-23 15:49:26 UTC
Red Hat Product Errata RHSA-2020:1454 0 None None None 2020-04-14 13:29:03 UTC

Description Stefan Meyer 2020-03-02 10:36:34 UTC
Description of problem:
When using ansible-runner instead of ansible-playbook in Satellite 6.6.2 playbooks that are not assigned are executed

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

How reproducible:
Whenever ansible-runner is used for ansible playbooks.

Steps to Reproduce:
1. Set Satellite to use ansible-runner to execute playbooks instead of ansible-playbook
2. Install 3 clients, client-a to client-c
3. Create 3 hostgroups and add each client to a different hostgroup
4. Add different ansible playbooks to each hostgroup
5. select all 3 clients in "All Hosts"
6. Run "Play Ansible Roles"


Actual results:
The correct playbooks are listed if you then check it in "Preview Templates" but it seems that 
all playbooks that are assigned to the first client in the list is executed on all clients.

This is not the expected behavior and may damage customer systems if Satellite runs not assigned
playbooks.


Expected results:
Only playbooks that are assigned should be executed on clients.
Satellite needs to calculate which clients have the same playbooks assigned and only group these
in ansible-runner tasks.

Additional info:

Comment 6 Adam Ruzicka 2020-03-04 14:29:21 UTC
Created redmine issue https://projects.theforeman.org/issues/29261 from this bug

Comment 11 Lukas Pramuk 2020-03-10 08:28:40 UTC
FailedQA.

@Satellite 6.7.0 Snap15
tfm-rubygem-foreman_ansible-4.0.3.1-1.el7sat.noarch

using following reproducer:

1) Register 2 Hosts and set them up for REX
2) Import 2 ansible roles
3) Assign 1st role to 1st host and 2nd role to 2nd host
4) schedule Ansible play roles for the hosts

>>> for every host all roles were played

Comment 12 Lukas Pramuk 2020-03-10 09:18:09 UTC
Not all roles were played. Only the output is a bit misleading.
There are listed tasks for all roles but played tasks have "ok"

The played task:
-------
TASK [linuxhq.setup : Ensure that the setup package is installed] **************
ok: [host1.example.com]
-------

The task that wasn't played (no "ok"):
-------
TASK [geerlingguy.ntp : Include OS-specific variables.] ************************

-------

>>> Only the roles assigned to the specific host were played for the host

Comment 16 errata-xmlrpc 2020-04-14 13:28:54 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, 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-2020:1454


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