I have been successful configuring Ansible Tower project to pull from remote git repos, and also pulling from a local repo using ssh and stored credentials (keys). On this server, allowing ssh login to access git is not acceptable, so I am trying to configure Ansible Tower to use a local git repository; not using git: or ssh: protocol to access, just accessing it via file:///path/to/AnsibleTower.git
The Ansible Tower project-update function tries to 'git clone', but it gives an error:
"fatal: Could not read from remote repository.",
"Please make sure you have the correct access rights",
"and the repository exists."
And it shows this is the command it used to attempt to clone:
"cmd": "/usr/bin/git clone --origin origin file:///path/to/AnsibleTower.git/ /var/lib/awx/projects/_114__00_test"
When I execute the above command directly on the server, as the awx
user, I get no error and the clone works. I can see that the git commands is being executed with the awx
user when Tower attempts to update (watching ps for the process). The awx
user owns the AnsibleTower.git directory and everything in it.
The reason this is important and the reason I have tagged this 'ansible-inventory' is that using an SCM-backed project seems to be the only way to import/synchronize a text-based inventory to Tower. I would really like to avoid re-creating/updating my inventory using the Tower web interface; I want that tracked in SCM as well.
I even went so far as to grant all users access to the .git directory (temporarily); that didn't work either, it doesn't seem to be a user-permission issue.