<p>I am running <code>awx-operator</code> on a k3 cluster.
I have a role, <code>update_host_group</code>, that tries to use the AWX REST API to manipulate Ansible groups.</p>
<pre><code>---
- name: Update Ansible Tower inventory
  uri:
    url: https://awx.example.com/api/v2/groups/36/hosts
    user: &quot;{{ admin_username }}&quot;
    password: &quot;{{ admin_password }}&quot;
    method: 'POST'
    body: '{ &quot;name&quot; : &quot;{{ update_ati_fqdn }}&quot; }'
    force_basic_auth: yes
    status_code: 201
    body_format: json
    validate_certs: no
</code></pre>
<p>I created an inventory named &quot;AWX Meta Inventory&quot; which has just one host, <code>localhost</code>.
I also created a job template: &quot;Run Update Host Group Playbook&quot; that executes a playbook
that uses the role, <code>update_host_group</code>.  When I launch this template I get this error:</p>
<pre><code>TASK [update_host_group : Update Ansible Tower inventory] **********************
fatal: [localhost]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;elapsed&quot;: 0, &quot;msg&quot;: &quot;Status code was
 -1 and not [201]: Request failed: &lt;urlopen error [Errno -2] Name or service not known&gt;&quot;, 
&quot;redirected&quot;: false, &quot;status&quot;: -1, &quot;url&quot;: &quot;https://awx.example.com&quot;}
</code></pre>
<p>Note: Obvisouly don't actually use <code>example.com</code>.  I use my real domain name.</p>
<p>UPDATE:
I have tried adding <code>hostAliases</code> to my kubernetes but I am not well versed in k* admin.  I looked at the docs here: <a href="https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/</a></p>
<p>But of course that doesn't tell where in the <code>awx</code> deployment to add the <code>hostAliases</code> stanza. So I am just guessing and breaking things.  Does anyone know where I need to put my <code>hostAliases</code>?</p>

Red Cricket
<p>This is more sort of a workaround.  I am sure there is probably a better solution. I read the documentation here: <a href="https://docs.ansible.com/automation-controller/latest/html/administration/containers_instance_groups.html#customize-the-pod-spec" rel="nofollow noreferrer">https://docs.ansible.com/automation-controller/latest/html/administration/containers_instance_groups.html#customize-the-pod-spec</a></p>
<p>Then I:</p>
<ul>
<li>Logged into my AWX Web UI</li>
<li>Navigated to Administration &gt; Instance Groups</li>
<li>clicked on the pencil icon to edit the <em>default</em> instance group</li>
<li>clicked the <em>Customize pod specification</em> radio button</li>
<li>and then added these lines just above the <code>containers:</code> line:</li>
</ul>
<pre><code>hostAliases:
  - hostnames:
    - awx.example.com
    ip: 10.0.3.52
</code></pre>
<p>then click the apply button and my task worked (had to update the <code>status_code</code> to look for status code 204).</p>
