I was setting up Ansible on my laptop yesterday, I installed it via HomeBrew, everything seemed to work perfectly that was until I was trying to setup my connection to my ec2 instance.
I was trying to add a line to point to my pem file. This is where I found out there is no /etc/ansible/ansible.cfg.
To get around this small issue, I just created one for this purpose, and it works perfectly, now this is not a full config file, but for this simple issue it works perfectly.
Steps are
sudo vi /etc/ansible/ansible.cfg Added in [defaults] private_key_file = /tmp/my.pem
From there I saved the file then when I connected it worked exactly as it should
ansible all -i /etc/ansible/hosts -u ec2-user -m ping | SUCCESS => { "changed": false, "ping": "pong" }
Hope this helps, like I say it's not a full file, you can't just add the private_key_file line, it will error saying about the headers not being there, hence you need to add the defaults header.
I am always interested in your thoughts so if you have any comments or feedback then please feel free to add any comments, or you can mail me here.