# Unexpected behaviour of "git" plugin

**URL:** <https://forum.ansible.com/t/unexpected-behaviour-of-git-plugin/36711>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [June 9, 2022, 7:48pm UTC](https://forum.ansible.com/t/unexpected-behaviour-of-git-plugin/36711 "2022-06-09T19:48:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil\_Young](https://avatars.discourse-cdn.com/v4/letter/n/a3d4f5/32.png) [@Neil\_Young](https://forum.ansible.com/u/Neil_Young)\
**Post date:** [June 9, 2022, 7:48pm UTC](https://forum.ansible.com/t/unexpected-behaviour-of-git-plugin/36711/1 "2022-06-09T19:48:58Z")

</div>

I’m noticing a strange issue with the git plugin while attempting to checkout a special tag of that project.

Doing the same for about 20 subprojects of the same project works fine.

Also doing equivalent orders at console works fine:

This is the problem:

Works:

git clone [https://github.com/Kurento/kms-cmake-utils](https://github.com/Kurento/kms-cmake-utils)  
cd kms-cmake-utils  
git checkout tags/6.16.0

Does not work, hangs in the checkout step and fails after a couple of minutes with an obscure timeout error:

- name: KMS-CMAKE-UTILS - Clone (run as non-privileged user)  
tags: kms-cmake-utils  
git:  
repo: ‘[https://github.com/Kurento/kms-cmake-utils](https://github.com/Kurento/kms-cmake-utils)’  
dest: ~/{{ kms\_build\_dir }}/kms-cmake-utils  
version: “tags/{{ kurento\_media\_server\_version}}”  
force: yes  
become: yes  
become\_user: “{{ non\_root\_user }}”

kms\_build\_dir is “kms-build”  
kurento\_media\_server\_version is “6.16.0”  
non\_root\_user is “ubuntu”

The error is

ASK [KMS-CMAKE-UTILS - Clone (run as non-privileged user)] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [kms7]: FAILED! =\> {“changed”: false, “msg”: “Failed to init/update submodules: Submodule ‘3rdparty/sanitizers-cmake’ (git://github.com/arsenm/sanitizers-cmake.git) registered for path ‘3rdparty/sanitizers-cmake’\nCloning into ‘/home/ubuntu/kms-build/kms-cmake-utils/3rdparty/sanitizers-cmake’…\nfatal: unable to connect to [github.com](http://github.com):\ngithub.com[0: 140.82.121.4]: errno=Connection timed out\n\nfatal: clone of ‘git://github.com/arsenm/sanitizers-cmake.git’ into submodule path ‘/home/ubuntu/kms-build/kms-cmake-utils/3rdparty/sanitizers-cmake’ failed\nFailed to clone ‘3rdparty/sanitizers-cmake’. Retry scheduled\nCloning into ‘/home/ubuntu/kms-build/kms-cmake-utils/3rdparty/sanitizers-cmake’…\nfatal: unable to connect to [github.com](http://github.com):\ngithub.com[0: 140.82.121.3]: errno=Connection timed out\n\nfatal: clone of ‘git://github.com/arsenm/sanitizers-cmake.git’ into submodule path ‘/home/ubuntu/kms-build/kms-cmake-utils/3rdparty/sanitizers-cmake’ failed\nFailed to clone ‘3rdparty/sanitizers-cmake’ a second time, aborting\n”}

-vvv doesn’t give much help

Anybody having an idea, what is going wrong here?

---

<div class="post-metadata">

**Author:** ![gtirloni](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gtirloni/32/4562_2.png) [@gtirloni](https://forum.ansible.com/u/gtirloni)\
**Post date:** [June 9, 2022, 8:24pm UTC](https://forum.ansible.com/t/unexpected-behaviour-of-git-plugin/36711/2 "2022-06-09T20:24:18Z")

</div>

That submodule is configured to use SSH to retrieve the git repository. Ensure your host can SSH to [github.com](http://github.com) or change submodule to use HTTPS instead.

---

<div class="post-metadata">

**Author:** ![Neil\_Young](https://avatars.discourse-cdn.com/v4/letter/n/a3d4f5/32.png) [@Neil\_Young](https://forum.ansible.com/u/Neil_Young)\
**Post date:** [June 9, 2022, 8:54pm UTC](https://forum.ansible.com/t/unexpected-behaviour-of-git-plugin/36711/3 "2022-06-09T20:54:40Z")

</div>

The host uses SSH to github and exposes that to the node

---

<div class="post-metadata">

**Author:** ![Neil\_Young](https://avatars.discourse-cdn.com/v4/letter/n/a3d4f5/32.png) [@Neil\_Young](https://forum.ansible.com/u/Neil_Young)\
**Post date:** [June 9, 2022, 8:55pm UTC](https://forum.ansible.com/t/unexpected-behaviour-of-git-plugin/36711/4 "2022-06-09T20:55:26Z")

</div>

I was working around by issuing the “checkout” as shell command.
