github pat not working as credential

106 views
Skip to first unread message

Baziel de Leeuw

unread,
Apr 21, 2023, 5:05:43 AM4/21/23
to AWX Project
Hi all,

AWX 22.0.0 external database that seems to be working ok, except it does not want to use my credentials in github.

I get

PLAY [Update source tree if necessary] ***************************************** TASK [Update project using git] ************************************************ fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/bin/git ls-remote 'https://$encrypted$:$encrypted$@github.com/Baziel/maintenance.git' -h refs/heads/HEAD", "msg": "fatal: unable to access 'https://github.com/Baziel/maintenance.git/': Failed to connect to github.com port 443: No route to host", "rc": 128, "stderr": "fatal: unable to access 'https://github.com/Baziel/maintenance.git/': Failed to connect to github.com port 443: No route to host\\n", "stderr_lines": ["fatal: unable to access 'https://github.com/Baziel/maintenance.git/': Failed to connect to github.com port 443: No route to host"], "stdout": "", "stdout_lines": []} PLAY RECAP ********************************************************************* localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

however if I manually type this command from the command prompt it works fine (pat code changed to *** for obvious reasons:

[vagrant@server2 ~]$ /usr/bin/git ls-remote 'https://Baziel:ghp_***@github.com/Baziel/maintenance.git' 4cd3dfd7a316be6923e557d95e73766b6bbc36a3 HEAD 4cd3dfd7a316be6923e557d95e73766b6bbc36a3 refs/heads/master [vagrant@server2 ~]$

Anybody any idea where I am going wrong?

credentials are added as follows, PAT as password as per instructions.

r/awx - github pat not working as credential

project is added like this:


r/awx - github pat not working as credential


Thanks,


Baziel

AWX Project

unread,
Apr 26, 2023, 2:43:20 PM4/26/23
to AWX Project
github PATs are not to be used for project updates, use a source control credential instead where you can provide a username/password or ssh private key to access your private github repo https://docs.ansible.com/automation-controller/latest/html/userguide/credentials.html#source-control

AWX Team
Reply all
Reply to author
Forward
0 new messages