Controlling Ansible options
Ansible is a customizable framework. It can be controlled by tuning its configuration via a configuration file. Options such as how Ansible looks during playbook execution, where Ansible can find extra details (e.g., local collections or roles), or even how Ansible connects to devices.
There is a precedence order in how Ansible configuration options are evaluated. These are fully documented in the Ansible docs (https://docs.ansible.com/ansible/latest/reference_appendices/config.html#ansible-configuration-settings); however, a quick ordered list is provided next:
- The
ANSIBLE_CONFIGenvironment variable - An
ansible.cfgfile in the local project directory - A
.ansible.cfgfile in the executing user’s home directory (for example,~/.ansible.cfg) - The system-wide configuration file:
/etc/ansible/ansible.cfg
Note
This is a first-match rule; as soon as it finds a config, it uses that.
With the...