ansible-galaxy git clone failures

Hello,

I was trying to clone roles using ansible-galaxy cli from private repo,

requirements file : working.yml

  • src: git+https://git@git.xxxxxx.com/devops/ansible-role-fpm.git

name: watever.fpm
version: master

ansible-galaxy install --role-file=ansible-galaxy.yml --roles-path=“${PWD}/roles/” --force

But its throwing errors like:

[WARNING]: - xxxxfpm was NOT installed successfully: - command git clone https://git@git.xxxxxx.com/devops/ansible-role-fpm.git
xxxx.fpm failed in directory /tmp/tmpGS0PhX (rc=128)

ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.

I tried different combinations of “git+ssh” but nothing worked, i can easily clone it directory using “git clone” way but ansible-galaxy way is not working, ideas ???

I face the same problem but using roles from git is failing for me as well (private as well as public repo).

Also indications from https://github.com/ansible/ansible/issues/8937 dit not help - the issue refers to ansible 1.8, wheres I am using 2.9.5

Hi

Thanks for using ansible. To answer your question more information is needed. Could you please describe clearly all of the below:

  • What goal you are trying to achieve.

  • How you are doing this.

  • What problems you encounter.

  • Which commands did you run, and what actual output did you get (copied as plain text - not as screenshots, images, or other binary attachments).

  • What do the relevant inventory/tasks/playbooks/code/variables look like.

  • The output of ‘ansible --version’

I have a requirements.yml which contains among other roles, roles which should be consumed directly from github/gitlab

  • src: geerlingguy.docker
  • src: dev-sec.ssh-hardening
  • src: m4rcu5nl.zerotier-one

own roles

- scr: git+https://git@github.com/papanito/ansible-role-rsyslog.git

name: papanito.rsyslog

scm: git

version: master

accept_hostkey: yes

installing the requirements fails

$ ansible-galaxy install -r requirements.yml -vvvv
ansible-galaxy 2.9.5
config file = /home/papanito/Workspaces/infrastructure/ansible.cfg
configured module search path = [‘/home/papanito/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python3.8/site-packages/ansible
executable location = /usr/bin/ansible-galaxy
python version = 3.8.1 (default, Jan 22 2020, 06:38:00) [GCC 9.2.0]
Using /home/papanito/Workspaces/infrastructure/ansible.cfg as config file
Reading requirement file at ‘requirements.yml’
found role {‘src’: ‘geerlingguy.docker’, ‘name’: ‘geerlingguy.docker’, ‘version’: ‘’, ‘scm’: None} in yaml file
found role {‘src’: ‘dev-sec.ssh-hardening’, ‘name’: ‘dev-sec.ssh-hardening’, ‘version’: ‘’, ‘scm’: None} in yaml file
found role {‘src’: ‘m4rcu5nl.zerotier-one’, ‘name’: ‘m4rcu5nl.zerotier-one’, ‘version’: ‘’, ‘scm’: None} in yaml file
found role {‘name’: ‘papanito.rsyslog’, ‘scm’: ‘git’, ‘version’: ‘master’} in yaml file
Processing role geerlingguy.docker
[WARNING]: - geerlingguy.docker (2.5.3) is already installed - use --force to change version to unspecified
Processing role dev-sec.ssh-hardening
[WARNING]: - dev-sec.ssh-hardening (7.0.0) is already installed - use --force to change version to unspecified
Processing role m4rcu5nl.zerotier-one
[WARNING]: - m4rcu5nl.zerotier-one (v1.2.2) is already installed - use --force to change version to unspecified
Processing role papanito.rsyslog
[WARNING]: - papanito.rsyslog was NOT installed successfully: - command /usr/bin/git clone papanito.rsyslog papanito.rsyslog failed in directory
/home/aedu/.ansible/tmp/ansible-local-914052zr2sg8jg/tmpp1mc9csj (rc=128)

I have a `requirements.yml` which contains among other roles, roles which should be consumed directly from github/gitlab

- src: geerlingguy.docker
- src: dev-sec.ssh-hardening
- src: m4rcu5nl.zerotier-one

# own roles
# - scr: git+https://git@github.com/papanito/ansible-role-rsyslog.git
# name: papanito.rsyslog
# scm: git
# version: master
- scr: https://github.com/papanito/ansible-role-rsyslog.git
name: papanito.rsyslog
path: roles
scm: git
version: master
# accept_hostkey: yes

You are using scr instead of src, which looks like a typo to me.

Regards
        Racke

Yeah right, I really didn’t spot that! Thanks a lot