Hi
I use ansible in various environments and I don’t want to mix them up. My question is, is there a way to tell asnible to look in the playbook root directory for a hosts file instead of using only one hosts file and switching that using the environment variable? I also propose to have something like this for picking up the hosts file when running a playbook:
- Look for it in the root directory of the project
- Look a the ANSIBLE_HOSTS variable
- Look at /etc/ansible/hosts
This way I can also ship my hosts file with the project which is very convenient instead of having to keep everything in one hosts file or changing the environment variable.