# "offline is not a failure" how?

**URL:** <https://forum.ansible.com/t/offline-is-not-a-failure-how/35650>\
**Category:** AWX Project\
**Tags:** windows, awx\
**Created:** [August 20, 2021, 8:00am UTC](https://forum.ansible.com/t/offline-is-not-a-failure-how/35650 "2021-08-20T08:00:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias\_Homann](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@Mathias\_Homann](https://forum.ansible.com/u/Mathias_Homann)\
**Post date:** [August 20, 2021, 8:00am UTC](https://forum.ansible.com/t/offline-is-not-a-failure-how/35650/1 "2021-08-20T08:00:33Z")

</div>

Hi,

I have a play in AWX that is running against a group of windows hosts, but I  
have a few more hosts that \*could\* be part of that group but they aren't  
always running.

How can I include those hosts in that group, but not have the play marked as  
failed if these hosts are offline when the play runs?

Cheers  
MH

---

<div class="post-metadata">

**Author:** ![Mathias\_Homann](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@Mathias\_Homann](https://forum.ansible.com/u/Mathias_Homann)\
**Post date:** [August 20, 2021, 8:23am UTC](https://forum.ansible.com/t/offline-is-not-a-failure-how/35650/2 "2021-08-20T08:23:58Z")

</div>

and related: what is the scope of a dynamic group? if I modify a group from  
within a play, are the modifications only visible in that play, or in other  
plays in the same workflow as well?

Cheers  
MH

---

<div class="post-metadata">

**Author:** ![Stefan\_Jakobs](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@Stefan\_Jakobs](https://forum.ansible.com/u/Stefan_Jakobs)\
**Post date:** [August 20, 2021, 10:45am UTC](https://forum.ansible.com/t/offline-is-not-a-failure-how/35650/3 "2021-08-20T10:45:44Z")

</div>

Hi,

I had a similar use case and I tried first to ping that host and if it’s not reachable add that to an “unreachable” group. Then exclude that group from all other plays.  
Here’s an example:

- name: Check if hosts are reachable  
hosts: all

gather\_facts: false

tasks:

- name: ping host  
ping:  
register: \_check\_ping  
ignore\_unreachable: true

- name: add unreachable hosts to new group  
add\_host:  
name: “{{ inventory\_hostname }}”  
groups: unreachable  
when: \_check\_ping.unreachable|default(false)

- name: Setup ESXi Hosts  
hosts: all:!unreachable  
gather\_facts: false

…

Regards  
Stefan
