Hello,
I have a jenkins job that installs to a Ansible to a virtual environment using pip install ansible
then runs ansible-playbook like ansible-playbook -v -i my_host_file my_playbook.yml
. On 7/5, the execution of ansible-playbook started failing with the following error:
GATHERING FACTS ***************************************************************
fatal: [ui.test.net] => {'msg': "FAILED: (22, 'Invalid argument')", 'failed': True}
This error appeared on the first task that ran - if I set gather_facts: no, it would fail on the first task. I was only able to reproduce this in Jenkins. The host is connectable from the Jenkins machine where the script ran.
The version of ansible installed was 1.2.2. I modified my install script to install from the git repository - pip install git+git://github.com/ansible/ansible.git@release1.2#egg=ansible
and the problem went away.
I thought I would share my findings. Has anyone else experienced this issue?
What OS is this?
Do you have anything set for ssh_args in ansible.cfg ?
This is running on CentOS 6.3. I don’t have an ansible.cfg file in use.
Below is my host file - the play runs against the user_interface hosts.
[skytap_user_interface]
ui.test.net ansible_ssh_host=192.169.172.1
[skytap_user_interface:vars]
cic_db_name=user_interface_database
cic_db_host=127.0.0.1
[user_interface]
[user_interface:children]
skytap_user_interface
Can you paste the output from when you are running with “-v -v -v” ?
+ ansible-playbook -v -v -v -i skytap_ui_hosts ansible/user_interface_test.yml
PLAY [user_interface] *********************************************************
GATHERING FACTS ***************************************************************
<192.169.7.1> ESTABLISH CONNECTION FOR USER: dataxu on PORT 22 TO 192.169.7.1
fatal: [ui.test.net] => {'msg': "FAILED: (22, 'Invalid argument')", 'failed': True}
Hmm.
I run a lot of tests on CentOS 6.3.
This is probably not enough for me to reproduce it, unfortunately.
Since you are using CentOS, however, I might suggest installing from EPEL.
I have only been able to reproduce it when running in a Jenkins job.
I should have been installing a specified version anyway, so my solution works well. I just wasn’t sure if anyone else had seen it.
Thanks for the help
Since you said this is 1.2.2 and you do not have an ansible.cfg I suspect it is trying to prompt you for a password and there’s no TTY.
Try disabling host key checking in ansible.cfg.
That did it - Instead of setting up the ansible.cfg, I set ANSIBLE_HOST_KEY_CHECKING to False before running ansible-playbook. It ran no problem.
export ANSIBLE_HOST_KEY_CHECKING=False
Thanks
This helped me too. Thanks.