3 ms·
>Ansible expects you to write host address into a file in /etc. So inconvenient. When I was first learning ansible, I was very frustrated about things like thi
by jmcqk6 8y ago
>Ansible expects you to write host address into a file in /etc. So inconvenient.
When I was first learning ansible, I was very frustrated about things like this. I came to learn, though, that it is very flexible, and this behavior, as well as other weirdness is completely overrideable.
Two ways to override this behavior, with the inventory.ini file in the same directory as the project:
1) ansible.cfg in the project directory that points to the inventory file (you can also override other default behaviors using this file.)
2) pass in a -i argument with the path to the file.
I usually just go with option 1, because I like overriding many of the default behaviors (like making cowsay random, or turning it off sometimes), or setting up my ansible vault.