Roles imported from a collection installed to /etc/ansible/collections are not found when run on hosts
Description of problem:
If an Ansible collection is installed on Foreman to /etc/ansible/collections, the roles from the collection are imported to Foreman, and roles from that collection are then assigned to a host, Foreman is unable to find those roles when Ansible roles are run on the host.
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 Foreman webUI.
3. Register a host to Foreman 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 Foreman webUI.
The task appears to complete successfully, but the roles from the collection are not actually run. The following error appears in the console entry for the task:
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
Roles in an Ansible Collection installed to /etc/ansible/collections run successfully on hosts.
If the same collection is installed to /usr/share/ansible/collections and the roles from the collection are imported to Foreman, those roles run successfully after being assigned to a host.
#1 Updated by Ondřej Pražák about 2 months ago
- Subject changed from Roles imported from a collection installed to /etc/ansible/collections are not found when run on hosts to Roles imported from a collection installed to /etc/ansible/collections are not found when run on hosts
- Project changed from Ansible to Installer
#4 Updated by Ondřej Pražák about 2 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset puppet-foreman_proxy|012d533ce0112f0ab974affb795998031f34763d.