# How to make ansible ignore a group name in hosts file if it has no ip?

**URL:** <https://forum.ansible.com/t/how-to-make-ansible-ignore-a-group-name-in-hosts-file-if-it-has-no-ip/36117>\
**Category:** Ansible Project\
**Created:** [December 15, 2021, 4:15pm UTC](https://forum.ansible.com/t/how-to-make-ansible-ignore-a-group-name-in-hosts-file-if-it-has-no-ip/36117 "2021-12-15T16:15:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [December 15, 2021, 4:15pm UTC](https://forum.ansible.com/t/how-to-make-ansible-ignore-a-group-name-in-hosts-file-if-it-has-no-ip/36117/1 "2021-12-15T16:15:07Z")

</div>

I have 2 groups created in hosts file as given below. I have a playbook consisting of 2 plays - the 1st play will be executed on IP in ‘ACTIVEFIREWALL’ group and 2nd play will be executed on IP in ‘STANDBYFIREWALL’ group.

Many a times, i have no ip to be give for ‘STANDBYFIREWALL’ group (so the ip portion remains blank but everything else mentioned below remains on hosts file). So the 2nd play just stops and does nothing until timeout. However when i delete the entire ‘STANDBYFIREWALL’ group from inventory file, Ansible ignores the 2nd play containing ‘STANDBYFIREWALL’ group and moves on.

Is there any ways i can make Ansible to move on without deleting STANDBYFIREWALL group from hosts file when there is no IP to give?

[ACTIVEFIREWALL]

FW1 ansible\_host=10.224.240.241

[ACTIVEFIREWALL:vars]

ansible\_user=username

ansible\_ssh\_pass=password

[STANDBYFIREWALL]

FW2 ansible\_host=10.224.240.244

[STANDBYFIREWALL:vars]

ansible\_user=username

ansible\_ssh\_pass=password

Thanks,

Vikram

---

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [December 15, 2021, 5:16pm UTC](https://forum.ansible.com/t/how-to-make-ansible-ignore-a-group-name-in-hosts-file-if-it-has-no-ip/36117/2 "2021-12-15T17:16:26Z")

</div>

Hi,

I am the OP and i just got an idea for my above question. Do you think below script might solve my issue?

- name: PLAYBOOK FOR STANDBY FIREWALL UPGRADE

Thanks,  
Vikram
