I am running awx-operator on a k3 cluster. I have a role, update_host_group, that tries to use the AWX REST API to manipulate Ansible groups.
UPDATE: I have tried adding hostAliases to my kubernetes but I am not well versed in k* admin. I looked at the docs here: https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/
But of course that doesn’t tell where in the awx deployment to add the hostAliases stanza. So I am just guessing and breaking things. Does anyone know where I need to put my hostAliases?
Hi,
Adding new record on your upstream DNS server is the best solution,
but if this is difficult for you, you can define new Container Group with customized pod specification and use it for your Job Template.
https://docs.ansible.com/automation-controller/latest/html/administration/containers_instance_groups.html#customize-the-pod-spec
Regards,
Thank you for your response. I didn’t get a chance to test it out yet but that bit of documentation does seem relevant. It is inserting though that I do have up stream DNS records but I do not think the container that is doing to gethostbyname() has a resolver in the /etc/resolv.conf that doesn’t know about my hostname.
Thank you kurokobo! That did the trick! I logged on to my awx web ui and navigated to Administration > Instance Groups, then edited the default instance group and clicked on the Customize pod specification radio button and added these line just above the containers:
line:
hostAliases:
- hostnames:
- awx.example.com
ip: 10.0.3.52