Score:0

Ansible Install with pip3 - which is the default ansible.cfg?

de flag

I have installed ansible on my contril machine (rhel8.3) via pip3 for my current user and would like to figure out which (of the many) existing ansible.cfg files is being utilized as default im my scenario.

$ find ~ -name ansible.cfg
/home/username/.local/lib/python3.6/site-packages/ansible/galaxy/data/apb/tests/ansible.cfg
/home/username/.local/lib/python3.6/site-packages/ansible/galaxy/data/container/tests/ansible.cfg
/home/username/.local/lib/python3.6/site-packages/ansible_test/_data/ansible.cfg
/home/username/.local/lib/python3.6/site-packages/ansible_collections/community/vmware/tests/integration/targets/vmware_vm_inventory/ansible.cfg
/home/username/.local/lib/python3.6/site-packages/ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/ansible.cfg
/home/username/.local/lib/python3.6/site-packages/ansible_collections/infinidat/infinibox/playbooks/ansible.cfg
/home/username/.local/lib/python3.6/site-packages/ansible_collections/netbox/netbox/ansible.cfg
/home/username/.local/lib/python3.6/site-packages/ansible_collections/sensu/sensu_go/docs/examples/installation/ansible.cfg

I tried to run some ad-hoc ping with the -v switch in order to get that information, but that did not really deliver. Can anybody point me to the default? I am aware I can always use a local .cfg file but would still understand what is my reference point in this scenario . obviousely there is no /etc/ansible

btw. complete Ansible novice here

Score:2
in flag

as mentioned in docs.ansible.com:

Changes can be made and used in a configuration file which will be searched for in the following order:

  • ANSIBLE_CONFIG (environment variable if set)
  • ansible.cfg (in the current directory)
  • ~/.ansible.cfg (in the home directory)
  • /etc/ansible/ansible.cfg

Ansible will process the above list and use the first file found, all others are ignored.

vrms avatar
de flag
thx, none of the mentioned existed though. I created an `~/ansible.cfg` then
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.