Categories
DevOps

How to display ansible configuration settings that have changed from the default

Display Ansible configuration settings that have changed from the default.

Display Ansible configuration file.

$ ansible-config view -vv
ansible-config 2.9.6
  config file = /home/milosz/Projekty/ansible/ansible.cfg
  configured module search path = ['/home/milosz/Projekty/ansible/library']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible-config
  python version = 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0]
Using /home/milosz/Projekty/ansible/ansible.cfg as config file
[ssh_connection]
pipelining = True
ssh_args   = -o ControlMaster=auto -o ControlPersist=30m -o ConnectTimeout=10 -o ConnectionAttempts=10 -o UserKnownHostsFile=/dev/null
[defaults]
ansible_managed         = "This file is managed by Ansible, don't make changes here - they will be overwritten."
vault_password_file     = .vault_pass.txt
roles_path              = ./roles
library                 = ./library
log_path                = ./ansible.log
host_key_checking       = False
nocows                  = 1
ANSIBLE_MODULE_LANG     = en_US.UTF-8
remote_user             = ansible
gathering               = smart
stdout_callback         = skippy
#callback_whitelist      = profile_tasks
[inventory]
enable_plugins = host_list, script, yaml, ini, auto

Display Ansible configuration settings that have changed from the default.

$ ansible-config dump --only-changed
ANSIBLE_NOCOWS(/home/milosz/Projekty/ansible/ansible.cfg) = True
ANSIBLE_PIPELINING(/home/milosz/Projekty/ansible/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/home/milosz/Projekty/ansible/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=30m -o ConnectTimeout=10 -o ConnectionAttempts=10 -o UserKnownHostsFile=/dev/null
DEFAULT_GATHERING(/home/milosz/Projekty/ansible/ansible.cfg) = smart
DEFAULT_LOG_PATH(/home/milosz/Projekty/ansible/ansible.cfg) = /home/milosz/Projekty/ansible/ansible.log
DEFAULT_MANAGED_STR(/home/milosz/Projekty/ansible/ansible.cfg) = This file is managed by Ansible, don't make changes here - they will be overwritten.
DEFAULT_MODULE_PATH(/home/milosz/Projekty/ansible/ansible.cfg) = ['/home/milosz/Projekty/ansible/library']
DEFAULT_REMOTE_USER(/home/milosz/Projekty/ansible/ansible.cfg) = ansible
DEFAULT_ROLES_PATH(/home/milosz/Projekty/ansible/ansible.cfg) = ['/home/milosz/Projekty/ansible/roles']
DEFAULT_STDOUT_CALLBACK(/home/milosz/Projekty/ansible/ansible.cfg) = skippy
DEFAULT_VAULT_PASSWORD_FILE(/home/milosz/Projekty/ansible/ansible.cfg) = /home/milosz/Projekty/ansible/.vault_pass.txt
HOST_KEY_CHECKING(/home/milosz/Projekty/ansible/ansible.cfg) = False
INVENTORY_ENABLED(/home/milosz/Projekty/ansible/ansible.cfg) = ['host_list', 'script', 'yaml', 'ini', 'auto']