# VMware action through Ansible

**URL:** <https://forum.ansible.com/t/vmware-action-through-ansible/25596>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [September 26, 2017, 11:24am UTC](https://forum.ansible.com/t/vmware-action-through-ansible/25596 "2017-09-26T11:24:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonay\_Herrera\_y\_Stee](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@Jonay\_Herrera\_y\_Stee](https://forum.ansible.com/u/Jonay_Herrera_y_Stee)\
**Post date:** [September 26, 2017, 11:24am UTC](https://forum.ansible.com/t/vmware-action-through-ansible/25596/1 "2017-09-26T11:24:48Z")

</div>

Hi,

Iam new to Ansible and I am trying to create a playbook to change the state of a bulk of Virtual Machines in Vmware. But I don’t now how to start ! I have read a lot of examples but I didn’t found any example to manipulate a bulk of virtual machines.

here is the playbook I am trying to build:

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [September 28, 2017, 3:01pm UTC](https://forum.ansible.com/t/vmware-action-through-ansible/25596/2 "2017-09-28T15:01:51Z")

</div>

You need a loop, you can do that with with\_items: in Ansible

---

<div class="post-metadata">

**Author:** ![Jonay\_Herrera\_y\_Stee](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@Jonay\_Herrera\_y\_Stee](https://forum.ansible.com/u/Jonay_Herrera_y_Stee)\
**Post date:** [September 28, 2017, 3:32pm UTC](https://forum.ansible.com/t/vmware-action-through-ansible/25596/3 "2017-09-28T15:32:03Z")

</div>

hi,

I found the solution, but it was not simple to find information and the error messages didn’t help to find what I did or was wrong. but here is how I fixed it.

first I need to run it on RHEL7 ( on RHEL6 I had a lot of issues ) and need to install the latest version of python-pyvmomi.noarch and then I needed to sort out which parameters are mandatory.
