Interview Prep/Ansible/Fundamentals and Architecture

In what order does Ansible look for `ansible.cfg`?

IntermediateConceptFundamentals and Architecture
Answer

The first one found wins; files are not merged:

  1. ANSIBLE_CONFIG environment variable
  2. ./ansible.cfg in the current directory
  3. ~/.ansible.cfg
  4. /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.

All Ansible questions Roadmap: Ansible

More on Fundamentals and Architecture