Ansible fails at “Gathering hosts” presumably because SSH is slow to connect. Setting `UseDNS no` resolves the issue

I haven't heard of Guestfish, thanks for the tip.

However, I think that I have found the cause of the mysterious name server. From the documentation:

net[n]: [model=]<enum> [,bridge=<bridge>] [,firewall=<1|0>] [,link_down=<1|0>] [,macaddr=<XX:XX:XX:XX:XX:XX>] [,queues=<integer>] [,rate=<number>] [,tag=<integer>] [,trunks=<vlanid[;vlanid...]>] [,<model>=<macaddr>] Specify network devices.

bridge=<bridge> Bridge to attach the network device to. The Proxmox VE standard bridge is called vmbr0.

If you do not specify a bridge, we create a kvm user (NATed) network device, which provides DHCP and DNS services. The following addresses are used:

10.0.2.2 Gateway
10.0.2.3 DNS Server
10.0.2.4 SMB Server
The DHCP server assign addresses to the guest starting from 10.0.2.15.

My procedure before was to do the following:

1) Create VM using Proxmox API through the Proxmox_KVM Ansible Module. 2) Clone four Kubernetes VMs from this VM. 3) Configure each of the Kubernetes VMs in turn.

During Step 1) I did, in fact, declare a bridge. However, In Step 2) I did not, as it is a simple qm clone. Which, according to the documentation, does not support a net[n] flag to be passed. It was at this point the random nameserver was introduced. Then, when step 3 came around, and I set a nameserver through cloud-init, it apended it to my /etc/resolv.conf file.

I'm currently reworking my Playbook to try and get around this by running a qm set ID --nameserver between Step 1) and Step 2).

/r/ansible Thread Parent