# Request your help

**URL:** <https://forum.ansible.com/t/request-your-help/29682>\
**Category:** Ansible Project\
**Created:** [February 14, 2019, 4:12pm UTC](https://forum.ansible.com/t/request-your-help/29682 "2019-02-14T16:12:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vino\_B](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@Vino\_B](https://forum.ansible.com/u/Vino_B)\
**Post date:** [February 14, 2019, 4:12pm UTC](https://forum.ansible.com/t/request-your-help/29682/1 "2019-02-14T16:12:38Z")

</div>

Hi All,

Request your help, below is the explanation of the issue that i have facing

- I have 2 task T1 and T1
- T1 has to executed on SERVER1 ,2,3
- T2 has to be executed only on SERVER1

**My Inventory -1**

[ALL]  
SERVER1

SERVER2

SERVER3

[PART1]  
SERVER2

[PART2]

**SERVER3-XXX** ansible\_host=SERVER3

I am able to accomplish this by using the below code using when condition if my Inventory file(**My Inventory -2)** is as below

- hosts: ALL

tasks:

- name : T1  
shell: xxxxxxx
- name : T2  
shell: xxxxxxx  
when: inventory\_hostname not in groups.PART1|union(groups.PART2)

**My Inventory -2**

ALL]  
SERVER1

SERVER2

SERVER3

[PART1]  
SERVER2

[PART2]

**SERVER3**

\*\*So request your help on how to accomplish this task when the Inventory file is structure is as "\*\ ***My Inventory -1"**

From,  
Vino.B
