From 63aad04c3ad6a943023a8b93737145ddce94164f Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Fri, 29 Mar 2024 11:05:09 -0400 Subject: [PATCH] more optimization --- ping.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ping.yml b/ping.yml index 7401a47..c8c8ac1 100644 --- a/ping.yml +++ b/ping.yml @@ -20,16 +20,17 @@ - name: Clear host errors ansible.builtin.meta: clear_host_errors - - name: Successful Hosts - ansible.builtin.debug: - msg: "{{ successful_hosts | default([]) + ansible_play_batch }}" + - name: Display ping results run_once: true # noqa: run-once[task] - delegate_to: localhost + block: + - name: Successful Hosts + ansible.builtin.debug: + msg: "{{ successful_hosts | default([]) + ansible_play_batch }}" + delegate_to: localhost - - name: Failed Hosts - ansible.builtin.debug: - msg: "{{ failed_hosts | default([]) + ansible_play_hosts_all | difference(ansible_play_batch) }}" - run_once: true # noqa: run-once[task] - delegate_to: localhost + - name: Failed Hosts + ansible.builtin.debug: + msg: "{{ failed_hosts | default([]) + ansible_play_hosts_all | difference(ansible_play_batch) }}" + delegate_to: localhost ...