Hello there,
I’m experiencing a strange behaviour with AWX and DNS resolution.
I have 3 AWX :
- An old one in 9.0.1 version directly installed on the OS (CentOS 7.7)
- Two recent in 20.0.0 version (integration and production) base on minikube (CentOS 8.5)
I have created a simple playbook that it permit to launch a simple shell command and display the output :
- name: One shot custom shell command
hosts: “{{ target }}”
become: true
tasks:
- name: Custom shell command
shell: “{{ custom_command }}”
register: command
- debug: msg=“{{ command.stdout }}”
Target = all
custom_command = cat /etc/redhat-release
I ran this job from my different AWX instances and here is the result :
AWX 9.0.1 = all hosts (24) well responding and the output is displayed like expexted
AWX 20.0.0 = hosts are randomly return “Failed to connect to the host via ssh: ssh: Could not resolve hostname myhostname: Name or service not known”. When i say randomly, it’s mean i ran the playbook 3 times and its not the same hostnames that AWX return this message for.
So i decided to look into my resolv.conf (On the OS) and here is the content :
options timeout:1 attempts:2
search test.fr
nameserver 10.1.2.3
nameserver 10.1.2.4
nameserver 10.1.2.5
I have tried all FQDN which failed during the template execution and they all working well.
So, i decided to check the resolv.conf into the container :
kubectl exec -it production-5f9dcf8dc5-fhm5d -c production-task – /bin/bash
bash-5.1$ cat /etc/resolv.conf
nameserver 10.96.0.10
search production.svc.cluster.local svc.cluster.local cluster.local test.fr
options ndots:5
The 10.96.0.10 IP correspond to the “ClusterIP” for kube-dns but i don’t see my DNS resolvers IPs in it. In contrast, i correctly have the search “test.fr”.
For information, no issue detected on my DNS servers side.
Anydone does experienced this behaviour and have a clue to help me to resolve?
Regards,
John