I am trying awx today. I moved a playbook which runs fine on Ansible core.
This playbook is dependant on the cisco.ios module. From what I have read I have to have a /var/lib/awx/projects/collection/requirements.yml file with the following content;
I did a small type, the filename I am using is /var/lib/awx/projects/collections/requirements.yml
So, not in the directory collection but in the directory collections
Make sure your organization on AWX have a Galaxy Credential configured. (Organizations → Edit → Galaxy Credentials). The same organization have to be configured on your project.
Update your project and see if they will download your dependencies.
Example:
TASK [fetch galaxy collections from collections/requirements.(yml/yaml)] *******changed: [localhost] =>
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/download/ansible-posix-1.2.0.tar.gz to /var/lib/awx/projects/.__awx_cache/104__proteus/stage/tmp/ansible-local-1761740nltrmb/tmpxusz_if/ansible-posix-1.2.0-j0dnt50s
Installing 'ansible.posix:1.2.0' to '/var/lib/awx/projects/.__awx_cache/_104__proteus/stage/requirements_collections/ansible_collections/ansible/posix'
ansible.posix:1.2.0 was installed successfully
Downloading https://galaxy.ansible.com/download/community-general-3.2.0.tar.gz to /var/lib/awx/projects/.__awx_cache/104__proteus/stage/tmp/ansible-local-1761740nltrmb/tmpxusz_if/community-general-3.2.0-kpf8txcm
Installing 'community.general:3.2.0' to '/var/lib/awx/projects/.__awx_cache/_104__proteus/stage/requirements_collections/ansible_collections/community/general'
community.general:3.2.0 was installed successfully
In your playbook and in the play use
collections:
- cisco-ios
Sorry about the bullet point. It’s suppose to - outlook mobile playing up
I was pulling my hair as none of the approaches I tried were not pulling dependent modules/collections for F5 WAF integration. I was seeing a similar error as posted in this discussion for one of the F5 modules.
“ERROR! couldn’t resolve module/action ‘bigip_monitor_http’. This often indicates a misspelling, missing collection, or incorrect module path.”
Started making progress to use Project level collections/requirements.yml after linking the default ‘Ansible Galaxy’ credentials created during AWX installation to the Organization used by the jobs and templates.
I now see that F5 collections are being downloaded in the EE container during the job runs.
The AWX Project level collections approach keeps it clean to avoid Dockerfile changes each time we need a new Ansible collection or module for any automation efforts.
Thank you very much for the hint.