Credentials for Role(s) download via requirements.yml

I am attempting to use a requirements.yml file within the roles/ directory of a project that installs roles via git repos. The roles/requirements.yml file is formatted as such:

bash-4.4# cat roles/requirements.yml

  • src: git+ssh://git@gitserver:7999/project/ansible.role.juniper.junos.git
    scm: git
    name: Juniper.junos
    version: master

The issue is our git server is configured to only allow access via SSH and when the git clone is attempted upon the job execution it fails.

The project itself syncs fine within AWX using the associated stored credential we have within AWX but I am assuming the job execution fails because there isn’t a credential/key associated to the job itself or the underlying tasks executed within the playbook, such as the ansible-galaxy install via git with the roles/requirements.yml.

Is my assumption correct? If so, are there any solutions to this?

Doing some more testing after adding the awx user key to the repo, I’ve found that running the playbook via the CLI doesn’t import the role, but running ansible-galaxy install -r roles/requirements.yml works fine.

It only bombs and fails to pull the role down when executed via the playbook. I’m using the same ansible.cfg for the playbook (since it has the roles_path defined) for the playbook and ansible-galaxy install.