hi guys,
quick question for you when you have time, based on the following scenario:
- using a git project with an ansible inventory plugin (grazie ansible team!!!)
- thus retrieving my inventory on awx from my scm project
- assigning the yaml file as inventory file
one way to configure ansible in order to get it working:
- setup an ansible.cfg located in the root dir of my project and filed with :
[defaults]
inventory = ${ANSIBLE_HOME}/inventories
inventory_plugins = ${ANSIBLE_HOME}/inventory_plugins
[inventory]
enable_plugins = myplugin, ini
- create a yaml/python script according to existing inventory_plugins available on 2.4
- fix an issue with 2.4 (https://github.com/ansible/ansible/pull/31605) until 2.4.1
- declare environment variables tied with my inventory source configured in awx:
ANSIBLE_HOME: “/var/lib/awx/projects/_22__myproject”
ANSIBLE_CONFIG: “/var/lib/awx/projects/_22__myproject/ansible.cfg”
the questions are :
- any way/suggestion/idea in order to avoid to declare those env vars in awx ? like having an environment variable pointing to the related project would greatly help ? seems like a feature to request ? or did i miss something ? enabled debug in order to catch the variable passed to inventory plugin but no luck afaik
- just wondering what constraints led to change the pwd execution to the default inventory (e.d: ‘PWD’: ‘/usr/lib/python2.7/site-packages/awx/plugins/inventory’ )? probably because of the issue mentioned above ? once the fix in place, what should be the default pwd ?
thanks for your time
Franck