My playbook hangs while trying to do a commit. Sometimes when I hit cancel on the job it comes back with a “Username for ‘https://<gitlab_url>’:”. I’m trying to run this playbook within an Execution Environment. I don’t run into the same problem when running it outside of the playbook.
Here is the code where it is hanging:
name: Commit changes to repo on branch {{ branch }}
shell:
cmd: “git add . && git commit -m ‘Upgraded {{ majorVersion }} to {{ version }}’ && git push origin {{ branch }}”
chdir: “{{ repo_dir }}”
register: out
I’m not sure if it is expecting a Gitlab username at this point or if it is hanging on something else. I set both the git global user email and username just before running this code. Any ideas?
Another option is to use ssh instead of https and simply add the ssh private key to your credential in AWX and it should be “mounted” in the EE when running playbooks.
I would rather do the ssh option instead of https. I setup “GitLab Private Key” credentials within AAP. I might not be mounting this correctly. I’ve setup the mounting through “Settings | Job Settings | Paths to expose to isolated jobs” in AAP like “/home/gitlab_user/.ssh:/runner/project/.ssh:O”. Is there a different way I should be mounting it?
Tried it with machine credentials. Still hanging… Does that mount look correct? “/home/gitlab_user/.ssh:/runner/project/.ssh:O” I’m trying other options there to see if it needs to be something like /root/.ssh or something else but when I do a “cd ~” and “pwd” as a test in my playbook I get back /runner/project.
That seems pretty simple. Create the machine credentials and add them to the template. The playbook still hangs at the commit point looking for a username. What might I be missing?