Problem with ansible.cfg file provided by repository

77 views
Skip to first unread message

Federico Aguirre

unread,
Jul 6, 2015, 9:39:23 AM7/6/15
to ansible...@googlegroups.com
Hi folks,

I'm having a problem with ansible.cfg file which is built inside a repo and a playbook run by Jenkins. 
Basically the problem is that Ansible not read configurations from the ansible.cfg file provided by the repo.

So, the playbook fail with: ERROR: Unable to find an inventory file, specify one with -i ?

This is mi config file:

#########
[defaults]
inventory = ./inventory              <= Folder in which I have: hosts / ec2.ini and ec2.py files
host_key_checking = False
private_key_file = /home/jenkins/.ssh/private.pem                  <= Pem key to connect to servers

[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
#########

Thanks,
Federico

Brian Coca

unread,
Jul 6, 2015, 9:48:52 AM7/6/15
to ansible...@googlegroups.com
ansible.cfg is read from current working directory, ~/.ansible.cfg or
/etc/ansible/ansible.cfg, so you have to be in the same directory when
executing the play to pick it up.


--
Brian Coca

Federico Aguirre

unread,
Jul 6, 2015, 9:55:53 AM7/6/15
to ansible...@googlegroups.com
Thanks Brian.!!!!!!

Yep.! It was a path problem.!!!! It's solved.!

Thanks again.!
Fede
Reply all
Reply to author
Forward
0 new messages