Last week i was struggling with the Ansible module paths and virtual environments in AWX.
My structure looks like this:
1 2 3 4 5 6 7 8 9 10 |
GitProject: - playbooks - sap - sapplay.yml <- does not work - windows - winplay.yml - library - mycustom.py - play.yml <- works without extra ansible.cfg - ansible.cfg |
Had a couple issues with this setup.
Module not found in sub-directories, using ansible.cfg to define the following:
1 2 |
[default] library: ./library |
Works great until you enable the fact_cache checkbox (issue 2).
Ansible.cfg ignored when using the ansible fact_cache.
This problem is solved in the newest AWX versions.
For older versions you can define a global library variable in the AWX -> Settings -> Jobs -> Extra environment variables.
1 2 3 4 |
{ "HOME": "/var/lib/awx", "ANSIBLE_LIBRARY": "${PWD}/library" } |