From 20758ab52859fe77ed9f251f41d1be541d23d0d6 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Thu, 28 Mar 2024 10:37:58 -0400 Subject: [PATCH] changes --- ping.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ping.yml b/ping.yml index 5540605..bcb7800 100644 --- a/ping.yml +++ b/ping.yml @@ -7,17 +7,20 @@ tasks: - name: Ping target hosts ansible.builtin.ping: - register: ping_results + register: ping_check ignore_errors: true failed_when: false - - name: Display ping check results - ansible.builtin.debug: - msg: "{{ lookup('template', 'ping_results.j2') | from_yaml }}" + - name: Set ping check results + ansible.builtin.set_fact: + ping_results: "{{ lookup('template', 'ping_results.j2') | from_yaml }}" run_once: true # noqa: run-once[task] delegate_to: localhost - - name: Clear host error - ansible.builtin.meta: clear_host_errors + - name: Display ping check results + ansible.builtin.debug: + var: ping_results + run_once: true # noqa: run-once[task] + delegate_to: localhost ...