Bug 1983195 - Roles imported from a collection installed to /etc/ansible/collections are not found when run on hosts
Summary: Roles imported from a collection installed to /etc/ansible/collections are no...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible
Version: 6.10.0
Hardware: x86_64
OS: Linux
unspecified
medium vote
Target Milestone: 6.10.0
Assignee: Ondřej Pražák
QA Contact: Danny Synk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-16 19:37 UTC by Danny Synk
Modified: 2021-11-16 14:12 UTC (History)
5 users (show)

Fixed In Version: foreman-installer-2.5.2.2-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:12:49 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 33162 0 Normal New Roles imported from a collection installed to /etc/ansible/collections are not found when run on hosts 2021-07-28 11:26:57 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:12:56 UTC

Description Danny Synk 2021-07-16 19:37:05 UTC
Description of problem:
If an Ansible collection is installed on Satellite to /etc/ansible/collections, the roles from the collection are imported to Satellite, and roles from that collection are then assigned to a host, Satellite is unable to find those roles when Ansible roles are run on the host. 

Version-Release number of selected component (if applicable):
Satellite 6.10, snap 9
tfm-rubygem-foreman_ansible-6.3.1-1.el7sat.noarch
tfm-rubygem-smart_proxy_ansible-3.1.0-1.el7sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install an Ansible Collection to /etc/ansible/collections:

  # ansible-galaxy collection install ericsysmin.system -p /etc/ansible/collections/

2. Import the roles from the collection on the Configure > Roles page of the Satellite webUI.
3. Register a host to Satellite and configure it for remote execution.
4. Assign one or more roles from the collection to the host.
5. Select the "Run Ansible roles" option from the Hosts > All Hosts > [hostname] page of the Satellite webUI.

Actual results:
The task appears to complete successfully, but the roles from the collection are not actually run. The following error appears in the Dynflow console entry for the task:

~~~
  - output_type: stdout
    output: "\r\nTASK [Apply roles] *************************************************************\n"
    timestamp: 1626461088.7711945
  - output_type: stdout
    output: "\n"
    timestamp: 1626461088.7712917
  - output_type: stdout
    output: "\n"
    timestamp: 1626461088.771384
  - output_type: stdout
    output: "\n"
    timestamp: 1626461088.7714665
  - output_type: stdout
    output: "\n"
    timestamp: 1626461088.7716033
  - output_type: stdout
    output: 'ERROR! the role ''ericsysmin.system.chrony'' was not found in /tmp/d20210716-9401-1q84fq9/project/roles:/etc/ansible/roles:/usr/share/ansible/roles:/tmp/d20210716-9401-1q84fq9/project
~~~

Expected results:
Roles in an Ansible Collection installed to /etc/ansible/collections run successfully on hosts.

Additional info:
If the same collection is installed to /usr/share/ansible/collections and the roles from the collection are imported to Satellite, those roles run successfully after being assigned to a host.

Comment 3 Ondřej Pražák 2021-07-28 11:26:55 UTC
Created redmine issue https://projects.theforeman.org/issues/33162 from this bug

Comment 4 Bryan Kearney 2021-07-28 12:06:13 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 5 Bryan Kearney 2021-07-28 12:06:17 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 6 Bryan Kearney 2021-07-28 20:03:30 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/33162 has been resolved.

Comment 8 Danny Synk 2021-08-20 15:48:17 UTC
Verified on Satellite 6.10, snap 14.

Steps to test:

1. Install an Ansible Collection to /etc/ansible/collections.
2. Import the roles from the collection on the Configure > Roles page of the Satellite webUI.
3. Register a host to Satellite and configure it for remote execution with the Global Registration Template.
4. Assign one or more roles from the collection to the host.
5. Select the "Run Ansible roles" option from the Hosts > All Hosts > [hostname] page of the Satellite webUI.

Expected results:
Roles in an Ansible Collection installed to /etc/ansible/collections run successfully on hosts.

Actual results:
Roles in an Ansible Collection installed to /etc/ansible/collections run successfully on hosts.

Comment 11 errata-xmlrpc 2021-11-16 14:12:49 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 (Moderate: Satellite 6.10 Release), 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-2021:4702


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