Ansible - Config File
The config file is searched for in this order:
- ANSIBLE_CONFIG (environment variable if set)
- ansible.cfg (in the current directory)
- ~/.ansible.cfg (in the home directory)
- /etc/ansible/ansible.cfg
Example config file:
ansible.cfg[defaults] inventory = /etc/ansible/hosts host_key_checking = False
- NOTE - Turning host key checking off can be a security issue.
Config related commands:
ansible-config list # Print all config options
ansible-config dump # Dump configuration
ansible-config view # View configuration file