AWX "Failed to get token: The read operation times out"

Struggling to get a playbook to finish due to this error, see this reddit thread for details:

https://www.reddit.com/r/awx/comments/lastzb/awx_failed_to_get_token_the_read_operation_times/

Uhh this is a chicken and egg problem if i’ve ever seen one, this code:


- name: Create a new AWX token using username/password

delegate_to: 127.0.0.1

awx.awx.tower_token:

description: 'Creating token to test tower jobs'

scope: "write"

state: present

tower_host: "https://{{ tower_host }}"

tower_username: "{{ tower_username }}"

tower_password: "{{ tower_password }}"

- debug:

msg: "The token: {{ tower_token }}"

Produces the same error:

TASK [modify-awx-account : Create a new AWX token using username/password] *****

fatal: [dummyvalue.com]: FAILED! => {"changed": false, "msg": "Failed to get token: The read operation timed out"}

:S today is not a good day for me lol

make sure you set the tower hostname (base url of the tower host) in the gui config. If you don’t have it set properly you will get this message. The default setting is https://localhost, but it needs to match the exact url of your server