git module, accept_hostkey=yes doesn't work

302 views
Skip to first unread message

Damjan Georgievski

unread,
Apr 30, 2014, 9:27:59 AM4/30/14
to ansible...@googlegroups.com
I'm running the task:

- name: Cloning homepage repo... sudo_user: gitpull git: repo=ssh://g...@git.server.com:222/websites/homepage.com.git dest=/var/www/{{ branch}}/ version={{ branch }} accept_hostkey=yes changed_when: False
but the task gets stuck always. I've tried ansible 1.5.5, 1.5.0, 1.5.3 and the latest git (on ArchLinux).

This is the process tree when it's stuck:

25857 pts/1 S+ 0:00 \_ /usr/bin/python /tmp/ansible-tmp-1398860300.45-147818427778432/git 25859 pts/1 S+ 0:00 \_ /usr/bin/git ls-remote ssh://g...@git.server.com:222/websites/homepage.git -h refs/heads/master 25860 pts/1 S+ 0:00 \_ ssh -p 222 g...@git.server.com git-upload-pack '/websites/homepage.git'
If I strace that ssh process I see it tries to read from fd 4, which acording to /proc/25860/fd/4 is /dev/tty

/home/gitpull/.ssh/known_hosts is created but is empty.

I've tried manually cloning the repo and it asks me to confirm the host key, I say 'yes' it's added to known_hosts and the clone finishes soon after.
Then I'd remove /home/gitpull/.ssh/known_hosts and the task gets stuck again.

The target OS is Debian 7.5

Damjan Georgievski

unread,
Apr 30, 2014, 10:03:35 AM4/30/14
to ansible...@googlegroups.com

/home/gitpull/.ssh/known_hosts is created but is empty.

 
digging through the code it seems to me that the function add_host_key in module_utils/known_hosts.py doesn't support using a different port than the standard one??

Michael DeHaan

unread,
Apr 30, 2014, 4:18:27 PM4/30/14
to ansible...@googlegroups.com
This is quite possible given the accept_hostkey magic is new (you could also manage known_hosts yourself manually to get around this).

If you think this is a bug, please make sure it's filed on github.com/ansible/ansible.

(Patches also welcome!)

This way we won't lose track of it.

Thanks!



On Wed, Apr 30, 2014 at 10:03 AM, Damjan Georgievski <gda...@gmail.com> wrote:

/home/gitpull/.ssh/known_hosts is created but is empty.

 
digging through the code it seems to me that the function add_host_key in module_utils/known_hosts.py doesn't support using a different port than the standard one??

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/dfdeb0f9-fd64-4318-81dc-8ed4dc9d9f04%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

J Dav

unread,
Sep 16, 2014, 11:43:00 AM9/16/14
to ansible...@googlegroups.com
Also facing the same issue

Michael DeHaan

unread,
Sep 16, 2014, 1:10:07 PM9/16/14
to ansible...@googlegroups.com
Thanks, was a ticket filed on this one?

If you can't find a similar one, please do file a ticket.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages