All technological notes.
ANSIBLE_<PARAMETER_NAME>: All upper case.Ansible configuration file
By default, cf path:
/etc/ansible/ansible.cfgBy default, Ansible looks for configuration files in this order (first found is used):
ANSIBLE_CONFIG (environment variable if set)./ansible.cfg (in the current directory)~/.ansible.cfg (in the user’s home directory)/etc/ansible/ansible.cfg (system-wide default)If Ansible finds the above configuration, then the values defined in cf will be applied and the parameters that are not defined will be apply defautl values.
Common Sections in cf
Ways to override the default configuration:
Perssit parameters across shells ans uses
ansible.cfg within the directory of specific playbook.Execute a playbook using a cf rathen in the default path
ANSIBLE_CONFIG=/opt/ansible-web.cfg ansible-playbook web-playbook.yml
ANSIBLE_PARAMETER_NAME=new_value ansible-playbook playbook.yml
export ANSIBLE_PARAMETER_NAME=new_value
ansible-playbook playbook.yml
[defaults]Defines global defaults for Ansible.
Common Entries:
| Entry | Desc |
|---|---|
inventory |
path to the default inventory file. |
remote_user |
default SSH user. |
roles_path |
path to roles. |
host_key_checking |
whether to check SSH host keys. |
forks |
number of parallel processes. |
| CMD | DESC |
|---|---|
ansible-config list |
List all configuration |
ansible-config view |
Show the currently active config file |
ansible-config dump |
Show the current settings and where they are picked up |
ansible-config dump \| grep GATHERING |
Show the a specific paramter settings |