Hi
Thanks for the reply. I actually need this before I run the VM.
What I have done so far:
- Using the vsphere_guest module, create a VM, in the "present" state. The vmware_guest_facts seem to gather some information which includes a MAC address.
I use this mac address to setup a a static IP in the dnsmasq DHCP.
Once the VM starts up, installs via kickstart, I now have a known IP address and can run up in second ansible playbook against the new machine.
The bit I am still working out is to extract the MAC address in a loop and add it to the DNS server.
So far, I found that if I use register function in the task the gather the vmware_guest_facts, the MAC address is in the registered variable somewhere.
Finding a simple elegant way to get to this variable seem a bit of a challenge.
BTW I think the only way to get the guest IP address from a running system is if vmtools is installed - not sure....
Regards
Gerhard