initial project commit
This commit is contained in:
commit
b8a7ba7a78
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ansible.cfg
|
||||||
|
hosts
|
27
ping.yml
Normal file
27
ping.yml
Normal 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
|
||||||
|
|
||||||
|
...
|
Loading…
x
Reference in New Issue
Block a user