Hi
I am trying to run a callback define on a template on awx 1.0.6
when running the launch url the job runs on all hosts.
however, when activating callback i get the following error: No matching host could be found!
i tried defining several playbooks (no parameters, defined on all hosts. callback is enables) with no luck.
logs from awx only show:
2018-08-09 21:35:39,390 WARNING awx.api.generics status 400 received by user AnonymousUser attempting to access /api/v2/job_templates/8/callback/ from x.x.x.x
[pid: 138|app: 0|req: 875/1773] x.x.x.x () {36 vars in 498 bytes} [Thu Aug 9 21:35:38 2018] POST /api/v2/job_templates/8/callback/ => generated 42 bytes in 462 msecs (HTTP/1.1 400) 8 headers in 237 bytes (1 switches on core 0)
x.x.x.x - - [09/Aug/2018:21:35:39 +0000] “POST /api/v2/job_templates/8/callback/ HTTP/1.1” 400 42 “-” “curl/7.35.0” “-”
The host exists, has facts and is available via ssh. running the same playbook on that specific host from awx works.
any ideas?
Actually, while writing this post i figured out the problem.
hosts were using internal interface to reach the AWX server while they were registered with their external ip causing AWX to fail finding any service.
is there a way registering a server with two ids so that it could be found both by external and internal ips?
Awx can be configured to use specific http headers to identify the remote host.
How can i do that? is that a setting on awx or just adding specific headers on the request?
documentation reference would be greatly appreciated.
https://docs.ansible.com/ansible-tower/latest/html/administration/proxy-support.html#configure-known-proxies
AWX uses the remote host ip for two purposes:
- To construct the auth token so that an auth token is tied to an ip (among other things) … note this will change soon when we switch to django sessions
- identifying the remote host during a job template callback launch so AWX knows what --limit to send to the playbook run
It will be up to you to figure out how to get the hosts “true” ip into the header you select. Note that awx will try very hard to correlate the requesting host w/ the host in the inventory for example: