# vsphere\_guest provisioning and add\_host module : problem on dynamic inventory VS static inventory

**URL:** <https://forum.ansible.com/t/vsphere-guest-provisioning-and-add-host-module-problem-on-dynamic-inventory-vs-static-inventory/17491>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [February 10, 2015, 5:27pm UTC](https://forum.ansible.com/t/vsphere-guest-provisioning-and-add-host-module-problem-on-dynamic-inventory-vs-static-inventory/17491 "2015-02-10T17:27:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolas.wroclawski](https://avatars.discourse-cdn.com/v4/letter/n/977dab/32.png) [@nicolas.wroclawski](https://forum.ansible.com/u/nicolas.wroclawski)\
**Post date:** [February 10, 2015, 5:27pm UTC](https://forum.ansible.com/t/vsphere-guest-provisioning-and-add-host-module-problem-on-dynamic-inventory-vs-static-inventory/17491/1 "2015-02-10T17:27:45Z")

</div>

Hi Everyone,

I try to realise a playbook of autoprovisionning from scratch to “full installed application”  
I use the “ansible inventory” for guide the provisionning

I use a lot of group who describe the configuration of the target:

if the entries (hostname) is in inventory ansible group “on-vmware” : the playbook use vsphere\_guest module to create the host (by cloning) on a vmware cluster :

The cloning process is OK, my vm starts on a provisionning network =\> dhcp and vsphere\_facts give to me IP adress of the new vm ( owing to vmtools).

my playbook :

---

<div class="post-metadata">

**Author:** ![Giovanni\_Tirloni](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Giovanni\_Tirloni](https://forum.ansible.com/u/Giovanni_Tirloni)\
**Post date:** [February 13, 2015, 10:28am UTC](https://forum.ansible.com/t/vsphere-guest-provisioning-and-add-host-module-problem-on-dynamic-inventory-vs-static-inventory/17491/2 "2015-02-13T10:28:01Z")

</div>

Personally I wouldn't do this with roles, at least not for the  
provisioning phase.

I haven't worked with the vsphere\_guest module yet, but my suggestion is  
to have 2 plays in your playbook: first provision, add the new VM to  
your group, then a second play to configure the hosts (and apply roles).
