Ansible.cfg file's VALUES are not picking up during playbook run

,

We have added custom roles and collections path (both are mentioned below) to an Ansible.cfg file. We then uploaded this Ansible.cfg file in an Execution environment. We then attached the Execution environment to a template (this template is attached to a project) with and ran it in AWX.

collections_paths = ~/.ansible/collections:/usr/share/ansible/collections:./collections

roles_path = ~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:./roles

The problem is these values are not picked by AWX during template run.

We also tried adding these as variables and added into template, added the same Ansible.cfg file as a separate file in the playbook but still these values are not picked up.

Verbosity for the template has been set to : 2 (More Verbose)

We are using AWX in our environment.

Hello, Have you ever solved this issue? I have the same problem too. :worried_face:

If I’m understanding this; you are trying to add ./collections and ./roles to the search paths for collections and roles. The other values are essentially defaults with the exception of ~ being processed to the actual users home directory.

Is it possible that you are actually naming the file Ansible.cfg with a capital A? Linux is case sensitive by default and it would fail to find the file.

The default path for roles is in the playbook directory. If you have a playbook in a directory named playbooks/playbook.yml as an example it will look for roles in playbooks/roles. Is this why you are trying to force it to a new directory?

Additionally, instead of placing collections in the project I’d advocate for building an execution environment containing them or leveraging the dynamic installation feature via collections/requirements.yml. If you are bringing them locally because of not having access to Galaxy from AWX you could vendor the collection from upstream in your git forge.