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
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0f3be472-aa59-26fd-5151-38eef27a48ca%40olstad.com.
For more options, visit https://groups.google.com/d/optout.