initial project commit

This commit is contained in:
Chris Hammer 2024-03-25 20:11:51 -04:00
commit b8a7ba7a78
2 changed files with 29 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
ansible.cfg
hosts

27
ping.yml Normal file
View File

@ -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
...