ansibleyamldevopsansible-awx

Ansible- AWX login token API


I have installed Ansible-AWX and configured certain playbooks. I want to use the AWX API to run the ansible playbooks on a .net console application. However in order to do so I need a oauth token to login using the postman API. The problem is I am not able to generate the token. I have tried using the AWX cli and few other approaches still no positive results. Any leads would be appreciated.


Solution

  • Give it a shot here:

    curl -ku username:password -H "Content-Type: application/json" -X POST -d '{"description":"Tower CLI", "application":null, "scope":"write"}' http://<ip_address>/api/v2/users/1/personal_tokens/ | jq -r .token