From b8a7ba7a7807c1acaad8bce09c36d3aae66f7232 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Mon, 25 Mar 2024 20:11:51 -0400 Subject: [PATCH] initial project commit --- .gitignore | 2 ++ ping.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .gitignore create mode 100644 ping.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c5741ca --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +ansible.cfg +hosts diff --git a/ping.yml b/ping.yml new file mode 100644 index 0000000..836aaf4 --- /dev/null +++ b/ping.yml @@ -0,0 +1,27 @@ +--- +- name: Ping check to determine if hosts are reachable + hosts: all + become: false + gather_facts: true + + + tasks: + - name: Ping target hosts + ansible.builtin.ping: + register: ping_results + ignore_errors: true + failed_when: false + + - name: "Ping Check: Successful Hosts" + debug: + var: ansible_play_batch + run_once: true + delegate_to: localhost + + - name: "Ping Check: Failed Hosts" + debug: + msg: "{{ ansible_play_hosts_all | difference(ansible_play_batch) }}" + run_once: true # noqa: run-once[task] + delegate_to: localhost + +...