Answers: <p>Set <code>HTTP_X_FORWARDED_FOR</code> extra header as allowed in settings and you should be good.</p>
  <p><a href="https://github.com/ansible/awx/issues/8005" rel="nofollow noreferrer">https://github.com/ansible/awx/issues/8005</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2020-09-12T18:44:47.413Z
Answers: 2020-09-12T18:44:47.413Z
Answers: Most Wanted
Body: <p>I have on premise AWX and inventory (instances on AWS). To provision newly launched instance I want to use <a href="https://docs.ansible.com/ansible-tower/latest/html/userguide/job_templates.html#provisioning-callbacks" rel="nofollow noreferrer">provisioning callbacks</a>.
  But when executing this command from the instance</p>
  <pre><code>$ curl -v -H 'Content-Type:application/json' -d '{&quot;host_config_key&quot;: &quot;key1&quot;}' https://my-host.com/api/v2/job_templates/28/callback/
  </code></pre>
  <p>an error occurs</p>
  <pre><code>{&quot;msg&quot;:&quot;No matching host could be found!&quot;}
  </code></pre>
  <p>What might be wrong with AWX configuration if host is present within the dynamic inventory and <code>UPDATE ON LAUNCH</code> flag is enabled?</p>
  
Tags: <amazon-web-services><ansible><provisioning><awx>
Title: AWX cannot find matching host
UserDisplayName: Most Wanted
ThreadText: # AWX cannot find matching host
  
  (Asked by: username_0 on 2020-08-17)
  
  I have on premise AWX and inventory (instances on AWS). To provision newly launched instance I want to use [provisioning callbacks](https://docs.ansible.com/ansible-tower/latest/html/userguide/job_templates.html#provisioning-callbacks).
  But when executing this command from the instance
  
  ```
  $ curl -v -H 'Content-Type:application/json' -d '{"host_config_key": "key1"}' https://my-host.com/api/v2/job_templates/28/callback/
  
  ```
  
  an error occurs
  
  ```
  {"msg":"No matching host could be found!"}
  
  ```
  
  What might be wrong with AWX configuration if host is present within the dynamic inventory and `UPDATE ON LAUNCH` flag is enabled?
  
  **Tags:** amazon-web-services, ansible, provisioning, awx
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-09-12. Score: 0 | Accepted answer
  
  Set `HTTP_X_FORWARDED_FOR` extra header as allowed in settings and you should be good.
  
  <https://github.com/ansible/awx/issues/8005>
  
  
  ---
  
  