Ansible Default Settings: Where to Find?

If I’m not mistaken, earlier when we ran the command vi /etc/ansible/ansible.cfg, we saw the following default values in the ansible.cfg file, but now they’re missing. Where can we find these default settings ?

[defaults]
inventory = hosts
remote_user = ubuntu
become = yes
become_method = sudo

[ssh_connection]
ssh_args = -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no

where can we find this default settings ?

It would depend how ansible was installed, although that’s the default location. User settings are at ~/.ansible.cfg. Or ansible.cfg in the current directory. More info here.

“It would depend how ansible was installed” , Sir what does this mean ?
I used the following commands to install Ansible:

apt update -y
apt install software-properties-common
add-apt-repository --yes --update ppa:ansible/ansible
apt install ansible -y

If there is any better opyion kindly inform .
Thank you ,
Deepak.

It would depend on what whose package you use for ansible. Generally speaking, most packagers like to put reasonable defaults together with a server package (along with, say, unit files for systemd), but it’s variable. If you’re looking at our labs, we might also do something different. RedHat, Debian, Ubuntu and the Ansible project will all create slightly different contents of their ansible packages.

1 Like