Installing collections automatically via requirements for Execution Environment

,

Hi guys. How are you?

Let’s say I have a structure like this uploaded to AWX.

source/

some_organizational_stuff/

playbooks/

playbook.yml

roles/

role_example/

tasks/

main.yml

In this scenario, playbook.yml will be executed and it includes the role: role_example.

role_example makes use of the community. general collection or any other.

I’m trying to make AWX automatically download and install the collection using the file requirements.yml

But I have tried it many times, I tried placing it under roles, and I tried under role_example. But none has worked.

I know it’s possible to add it to the repository or build a new execution environment. But for my current scenario, those options are not preferred.

Is it possible to dynamically make AWX download any collection based on requirements configuration?

Thank you for your time.

Hi,

Could you please try placing your requirements.yml as collections/requirements.yml on your project root and syncing your project?

Refer:
https://github.com/ansible/awx/blob/devel/docs/collections.md
https://docs.ansible.com/automation-controller/latest/html/userguide/projects.html#collections-support

Yeeep

You are absolutely correct. Thank you for your help. Saved a lot of time here.

TASK [fetch galaxy collections from collections/requirements.(yml/yaml)] *******
changed: [localhost] => (item=/var/lib/awx/projects/_14__test_104907497_pm/collections/requirements.yml)