In what order does Ansible look for `ansible.cfg`?
IntermediateConceptFundamentals and Architecture
Answer
The first one found wins; files are not merged:
ANSIBLE_CONFIGenvironment variable./ansible.cfgin the current directory~/.ansible.cfg/etc/ansible/ansible.cfg
Individual settings can also be overridden by ANSIBLE_* environment variables or CLI flags. Check what is in effect with ansible --version (shows the config file) and ansible-config dump --only-changed.
A world-writable current directory is ignored for security, with a warning.
More on Fundamentals and Architecture
What is Ansible and what problem does it solve?BeginnerWhat does "agentless" mean in Ansible?BeginnerWhat are the requirements for the control node?BeginnerWhat does a managed node need?BeginnerIs Ansible push-based or pull-based?BeginnerWalk through what happens when you run `ansible-playbook site.yml`.Intermediate