ansible.cfg – file priority

We can have the ansible.cfg file at various locations, the default location shipped with ansible installation is at,

/etc/ansible/ansible.cfg

The default ansible.cfg has the least priority when you have multiple ansible.cfg defined in your system/server.

The priority is set to ansible.cfg file is based on how it is defined or stored,

  • ANSIBLE_CONF – Environment variable, defined in your server/system.
  • ./ansible.cfg – Ansible config file defined in your current working directory.
  • ~/.ansible.cfg – Ansible config file defined in your home directory.
  • /etc/ansible/ansible.cfg – Ansible config file defined in default location.