I'm using Ansible to provision the VMs, which works fine. Dnsmasq handles the DHCP so they get an IP automatically. However, there is no DNS configured so the VMs cannot communicate with each other by hostname, only by IP.

I've read a couple of guides which tells me I have to create a new domain with virsh net-define and virsh net-edit. However, I have to do that manually. This guide is the one I have been following.

Is it possible to somehow do it automatically, is it any better way than the guide I provided?

Just as a simplicity, I have added the hosts to /etc/hosts but it feels like there should be better solutions?

  • 1
    What makes this an ansible question? – 0xSheepdog Dec 20 '19 at 3:18
  • You are correct, it wasn't really related to Ansible. However, I'm using Ansible, and thought that adding that tag maybe someone has a module or anything that they use. – Sebastian Berglönn Dec 23 '19 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.