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

On Friday, September 19, 2014 2:02:46 AM UTC+10, James Cammarata wrote:
>
> Hi Gerhard,
>
> We do have an inventory script for VMware (plugins/inventory/vmware.py) in 
> the source repository, however it does not currently return any network 
> information regarding the guest VM's which are running. Could you open an 
> issue on GitHub for this, and we'll see if we can expand that inventory 
> script to return more info regarding the guests.
>
> Thanks!
>
> On Thu, Sep 18, 2014 at 9:10 AM, Gerhard Hannemann <[email protected] 
> <javascript:>> wrote:
>
>> Hi
>>
>> I am sure this have been asked before.....
>> I am trying to use ansible to provision new VMWare guests on my ESXi 
>> cluster.So far I have a kickstart custom iso image which can build a base 
>> working operation system.
>> I have an ansible playbook which can turns this base system into a 
>> patched and fully configuration application server.  Those individual parts 
>> work.  
>> What I cannot seem to get around is to get the base system a known IP 
>> address.  The plan is to provide and IP address that is defined int he 
>> ansible inventory.  At the moment, set that IP address manually - which is 
>> annoying.
>> I have looked tat vsphere_guest but do not see a way of doing this.
>>
>> Any ideas?
>>
>>
>> Regards
>> Gerhard
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/aa17c549-365a-4245-a304-034950844d99%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/aa17c549-365a-4245-a304-034950844d99%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/60eb51b5-d5e7-4091-a68a-1b0f20ddc6e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to