On 04. aug. 2017 17:45, William McKenzie wrote:
> OK, this works: you store the results, clear errors on hosts and look for
> problem children.
>
>
> ---
> - hosts: all
> gather_facts: no
> tasks:
> - block:
> - setup:
> register: result
>
> - name: clearing host errors
> meta: clear_host_errors
>
> - block:
> - local_action:
> module: slack
> token: "redacted"
> msg: "Ping failed on host {{inventory_hostname}}"
> when: result.unreachable is defined
It will only work if at least one host is reachable, but that's probably
good enough.
By the way, you don't need your two block: since they only have one task
each.
--
Kai Stian Olstad