# How to apply/run playbook target at a specific group of machines in the ini-style inventory

**URL:** <https://forum.ansible.com/t/how-to-apply-run-playbook-target-at-a-specific-group-of-machines-in-the-ini-style-inventory/35884>\
**Category:** Ansible Project\
**Created:** [October 16, 2021, 4:25pm UTC](https://forum.ansible.com/t/how-to-apply-run-playbook-target-at-a-specific-group-of-machines-in-the-ini-style-inventory/35884 "2021-10-16T16:25:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Ngo](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@James\_Ngo](https://forum.ansible.com/u/James_Ngo)\
**Post date:** [October 16, 2021, 4:25pm UTC](https://forum.ansible.com/t/how-to-apply-run-playbook-target-at-a-specific-group-of-machines-in-the-ini-style-inventory/35884/1 "2021-10-16T16:25:53Z")

</div>

Hello everyone,  
I am a pretty new face to Ansible. I can follow instruction pretty good however, I need your help with the following scenario.  
I created an .INI style inventory file called “hosts”, with basically categorize our devices/servers in different groups like below

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [October 16, 2021, 4:59pm UTC](https://forum.ansible.com/t/how-to-apply-run-playbook-target-at-a-specific-group-of-machines-in-the-ini-style-inventory/35884/2 "2021-10-16T16:59:14Z")

</div>

Then the issue must in the playbook itself.  
What does that look like?

---

<div class="post-metadata">

**Author:** ![James\_Ngo](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@James\_Ngo](https://forum.ansible.com/u/James_Ngo)\
**Post date:** [October 16, 2021, 5:27pm UTC](https://forum.ansible.com/t/how-to-apply-run-playbook-target-at-a-specific-group-of-machines-in-the-ini-style-inventory/35884/3 "2021-10-16T17:27:07Z")

</div>

Hi,

Right, it maybe the playbook itself. Anyway, the play1.yml is per below:

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [October 16, 2021, 5:37pm UTC](https://forum.ansible.com/t/how-to-apply-run-playbook-target-at-a-specific-group-of-machines-in-the-ini-style-inventory/35884/4 "2021-10-16T17:37:30Z")

</div>

That “\*” is a bit unusual (to me at least).  
Try:

hosts: all

And then see if the issue is still there

---

<div class="post-metadata">

**Author:** ![James\_Ngo](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@James\_Ngo](https://forum.ansible.com/u/James_Ngo)\
**Post date:** [October 16, 2021, 5:56pm UTC](https://forum.ansible.com/t/how-to-apply-run-playbook-target-at-a-specific-group-of-machines-in-the-ini-style-inventory/35884/5 "2021-10-16T17:56:29Z")

</div>

I have changed to “host: all” per your suggestion, it unfortunately did not help…  
It does not like the -i ./inventory/hosts Windows  
But if I just do -i ./inventory/hosts (without the group “Windows”), it will work but it will do all the devices/machines instead of just a specific group (which I want to)  
Thank you

---

<div class="post-metadata">

**Author:** ![James\_Ngo](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@James\_Ngo](https://forum.ansible.com/u/James_Ngo)\
**Post date:** [October 16, 2021, 9:18pm UTC](https://forum.ansible.com/t/how-to-apply-run-playbook-target-at-a-specific-group-of-machines-in-the-ini-style-inventory/35884/6 "2021-10-16T21:18:03Z")

</div>

I actually figured it out, should use the -l

-i ./inventory/hosts -l Windows

Works like a charm!
