Jenkins Failed to connect to the host via ssh

932 views
Skip to first unread message

haza...@gmail.com

unread,
Jul 8, 2016, 2:08:25 AM7/8/16
to Jenkins Users
Hi ,

I have installed Jenkins on AWS EC2 instance. I have created Maven Project and added the settings to run "Ansibe Playbook" in post-builds section of Jenkins.

While Jenkins executing the "ansible-playbook" im getting the below error.

[workspace] $ ansible-playbook /home/ubuntu/playbooks/petclinic.yml -i /etc/ansible/hosts -s -U root -f 5

PLAY [MavenServers] ************************************************************

TASK [setup] *******************************************************************
fatal: [54.169.xx.xx]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true}
 [ERROR]: Could not create retry file '/home/ubuntu/playbooks/petclinic.retry'.
The error was: [Errno 13] Permission denied:
'/home/ubuntu/playbooks/petclinic.retry'

PLAY RECAP *********************************************************************
54.169.xx.xx       : ok=0    changed=0    unreachable=1    failed=0   

Please help me.

Thanks in advance.

--Hazar.

jcsirot

unread,
Jul 8, 2016, 11:59:23 AM7/8/16
to Jenkins Users
Hello,

Is the host ssh key installed in the $HOME/.ssh dicrectory of the jenkins user?

-- 
Jean-Christophe

Hazar N

unread,
Jul 8, 2016, 3:37:04 PM7/8/16
to jenkins...@googlegroups.com

Hi,

Thanks for the reply.

In the remote machine, generated public key and copied into the "authorized-keys" file of Jenkins. Is this correct way?

Thanks,
Hazar.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/6sFyJFN-URE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/32a4faa8-1438-41b6-b9d0-11332ab049ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

anirudh vasudevan

unread,
Nov 8, 2016, 9:37:23 AM11/8/16
to Jenkins Users
Hi Hazar,

Am facing the same exact issue, did you manage to get it working?

Please let me know what is the workaround


Thanks,

Anirudh
Reply all
Reply to author
Forward
0 new messages