# Plybook with community.vmware modules & inventory item issue

**URL:** <https://forum.ansible.com/t/plybook-with-community-vmware-modules-inventory-item-issue/34729>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [March 6, 2021, 7:53am UTC](https://forum.ansible.com/t/plybook-with-community-vmware-modules-inventory-item-issue/34729 "2021-03-06T07:53:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 6, 2021, 7:53am UTC](https://forum.ansible.com/t/plybook-with-community-vmware-modules-inventory-item-issue/34729/1 "2021-03-06T07:53:54Z")

</div>

Hi

I am using community.vmware related modules in a playbook … which updates tags & reboot vms

In the same vm i would like to patch the VM

Below is the code … but the yum module here seems not acting on the target ie “{{ vm\_name }” but does not the ansible control node itself

Any suggestions Please ( My requirement is not to use separate playbook )

---

<div class="post-metadata">

**Author:** ![Jorge\_Rua1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@Jorge\_Rua1](https://forum.ansible.com/u/Jorge_Rua1)\
**Post date:** [March 6, 2021, 1:06pm UTC](https://forum.ansible.com/t/plybook-with-community-vmware-modules-inventory-item-issue/34729/2 "2021-03-06T13:06:25Z")

</div>

You should modify your hosts entry to point to inventory vms and delegate to localhost vmware tasks.

Hope that helps,

Regards

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 6, 2021, 8:20pm UTC](https://forum.ansible.com/t/plybook-with-community-vmware-modules-inventory-item-issue/34729/3 "2021-03-06T20:20:10Z")

</div>

Thanks for the reply … So you mean change below

---

<div class="post-metadata">

**Author:** ![Jorge\_Rua1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@Jorge\_Rua1](https://forum.ansible.com/u/Jorge_Rua1)\
**Post date:** [March 6, 2021, 8:27pm UTC](https://forum.ansible.com/t/plybook-with-community-vmware-modules-inventory-item-issue/34729/4 "2021-03-06T20:27:31Z")

</div>

Yep, that should do the trick.

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 6, 2021, 11:50pm UTC](https://forum.ansible.com/t/plybook-with-community-vmware-modules-inventory-item-issue/34729/5 "2021-03-06T23:50:48Z")

</div>

Thanks Again

Is below possible in this case :-

Section called New-VM-Section has many servers

But i would like playbook task of patching only on specific vm ?

eg

[New-VM-Section]  
vm1  
vm2  
vm3

And the playbook below to run only on say vm3 & not entire section called New-VM-Section

- hosts: New-VM-Section  
gather\_facts: false

…  
yum:…

I know below

To exclude host1 and host2 from execution and allow execution only in host3:

$ ansible-playbook --limit ‘!hoost1:!host2:host3’ yourPlaybook.yml

Is there way to rather “include” only 1 …

Also how to add this in playbook itself

Any suggestions Please

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [March 6, 2021, 11:56pm UTC](https://forum.ansible.com/t/plybook-with-community-vmware-modules-inventory-item-issue/34729/6 "2021-03-06T23:56:04Z")

</div>

Found this [https://stackoverflow.com/questions/18195142/safely-limiting-ansible-playbooks-to-a-single-machine](https://stackoverflow.com/questions/18195142/safely-limiting-ansible-playbooks-to-a-single-machine)

So folks saying better use -e of ansible-playbook
