diff --git a/ping.yml b/ping.yml index eb2b9c1..68cbc56 100644 --- a/ping.yml +++ b/ping.yml @@ -30,6 +30,8 @@ ansible.builtin.set_fact: successful_hosts: "{{ successful_hosts | default([]) + ansible_play_batch }}" failed_hosts: "{{ failed_hosts | default([]) + ansible_play_hosts_all | difference(ansible_play_batch) }}" + run_once: true # noqa: run-once[task] + delegate_to: localhost - name: Successful Hosts ansible.builtin.debug: diff --git a/templates/ping_results.j2 b/templates/ping_results.j2 deleted file mode 100644 index 5c6e422..0000000 --- a/templates/ping_results.j2 +++ /dev/null @@ -1,9 +0,0 @@ -success_hosts: -{% for shost in ansible_play_batch %} - - "{{ shost }}" -{% endfor %} - -failed_hosts: -{% for fhost in ansible_play_hosts_all | difference(ansible_play_batch) %} - - "{{ fhost }}" -{% endfor %}