ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.11k stars 3.43k forks source link

Project: Clone Git repo over HTTPS fails on Submodules using SSH #2166

Open nodje opened 6 years ago

nodje commented 6 years ago
ISSUE TYPE
COMPONENT NAME
SUMMARY

I've got a project under Git that is clonable with HTTPS only, and which references git Submodules using an SSH Url (on Github, not needing any credentials) And the clone operation fails when trying to init/update submodules.

ENVIRONMENT
ADDITIONAL INFORMATION

Error message: Failed to init/update submodules: Submodule 'roles/logwatch' (git@github.com:nodje/ansible-logwatch.git) registered for path 'roles/logwatch' etc.

kkruse-rax commented 5 years ago

Howdy,

I have the same issue with using git submodules as well. In a nutshell if you create a hierarchy like MAINREPODIR/ROLES/

Under that have ansible 'module' cloned into there with the 'git submodule' command.

Try to let it do the git submodule management it will bomb.

My ENV: AWX 3.0.0.0 AWX install method: installer playbook Ansible version: 2.7.0 Operating System: FC28

Submodules are neat, but often overlooked feature of git.

Zeek3000 commented 2 years ago

I had the same problem with a git repository that had a submodule in it. Adding the submodule repository as a project seems to allow the other repository to sync properly.

darknao commented 1 year ago

I confirm this is still an issue in AWX 22.3.0. The submodule init/update using ssh does not automatically add the host key to known_hosts, and fails with the error:

Failed to init/update submodules: Submodule 'whatever' (git@git.internal.corp:user/ansible-private.git) registered for path 'secrets'
Cloning into '/var/lib/awx/projects/_61__ansible_test/secrets'...
Host key verification failed.

As mentioned by @Zeek3000, the workaround is to create a dedicated project for the submodule repo and sync it once to add the host key to known_hosts. After that, the submodule init/update works as attended.