# Host related problem

**URL:** <https://forum.ansible.com/t/host-related-problem/29987>\
**Category:** Ansible Project\
**Created:** [March 26, 2019, 2:17am UTC](https://forum.ansible.com/t/host-related-problem/29987 "2019-03-26T02:17:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skdmeng](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@skdmeng](https://forum.ansible.com/u/skdmeng)\
**Post date:** [March 26, 2019, 2:17am UTC](https://forum.ansible.com/t/host-related-problem/29987/1 "2019-03-26T02:17:38Z")

</div>

Hello,  
I just starte to use ansible, now there is a question ， when during the batch execution of the playbook, some operations are performed only on one of the hosts. How do you avoid other hosts on a piaybook while performing these operations?

For example,：  
I will perform batch execution operations on three hosts, A,B and C, and some of them will only be executed in A. How to do this

---

<div class="post-metadata">

**Author:** ![Shankar\_Pentyala](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@Shankar\_Pentyala](https://forum.ansible.com/u/Shankar_Pentyala)\
**Post date:** [March 26, 2019, 3:17am UTC](https://forum.ansible.com/t/host-related-problem/29987/2 "2019-03-26T03:17:27Z")

</div>

You can pick only one host as below example.

[webservers]  
A  
B  
C

You can just pick host A by using

hosts: groups[‘webservers’][0]

In your playbook.

---

<div class="post-metadata">

**Author:** ![skdmeng](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@skdmeng](https://forum.ansible.com/u/skdmeng)\
**Post date:** [March 26, 2019, 3:27am UTC](https://forum.ansible.com/t/host-related-problem/29987/3 "2019-03-26T03:27:32Z")

</div>

- Thank you. I’ll try

skd…@126.com於 2019年3月26日星期二 UTC+8上午10時17分38秒寫道：

---

<div class="post-metadata">

**Author:** ![Vaibhav\_Singh](https://avatars.discourse-cdn.com/v4/letter/v/ecd19e/32.png) [@Vaibhav\_Singh](https://forum.ansible.com/u/Vaibhav_Singh)\
**Post date:** [March 26, 2019, 3:44am UTC](https://forum.ansible.com/t/host-related-problem/29987/4 "2019-03-26T03:44:25Z")

</div>

Please check your loop properly. Possible the loop may have some logical issues.

Thanks & Regards,

Vaibhav Singh

+91-8976871109
