# Ansible + vpshere\_guest

**URL:** <https://forum.ansible.com/t/ansible-vpshere-guest/17048>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [December 14, 2014, 6:56pm UTC](https://forum.ansible.com/t/ansible-vpshere-guest/17048 "2014-12-14T18:56:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmorcamp](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@fmorcamp](https://forum.ansible.com/u/fmorcamp)\
**Post date:** [December 14, 2014, 6:56pm UTC](https://forum.ansible.com/t/ansible-vpshere-guest/17048/1 "2014-12-14T18:56:31Z")

</div>

Hello all,

I’m starting with Ansible, and I would like to provsion a VMWare Cluster with it.  
To do that, I use the vsphere-guest module. However, I try to use it!

So I create a role /etc/ansible/role/esx/task/main.yml and try to set up a VM.  
I follow the the official documentetion: [http://docs.ansible.com/vsphere\_guest\_module.html](http://docs.ansible.com/vsphere_guest_module.html)

But when I try to run my playbook, it doesn’t work.  
I’ve this error:

> ansible-playbook -i /etc/ansible/hosts /etc/ansible/base.yml -C  
> GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> failed: [ip\_of\_esx] =\> {“failed”: true, “parsed”: false}  
> Traceback (most recent call last):  
> File “//.ansible/tmp/ansible-tmp-1418582864.23-99769666634275/setup”, line 204, in   
> import grp  
> ImportError: No module named grp

And I don’t find anything about this error, and I don’t know how to solve it…

pysphere in lastest version is install (easy\_install -U pysphere)  
I try this command: ansible esx -m raw -a “date”  
It works fine.

Somebody already try this module? Maybe I don’t use it well…

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [December 15, 2014, 4:31am UTC](https://forum.ansible.com/t/ansible-vpshere-guest/17048/2 "2014-12-15T04:31:27Z")

</div>

- hosts: vmware  
gather\_facts: false  
tasks:
- raw: uname -a
- vsphere\_guest:  
vcenter\_hostname: “{{ ansible\_ssh\_host|default(inventory\_hostname) }}”  
username: “{{ hostvars[inventory\_hostname].ansible\_ssh\_user|quote }}”  
password: “{{ hostvars[inventory\_hostname].ansible\_ssh\_pass|quote }}”  
guest: “My Guest”  
vmware\_guest\_facts: yes
