Files
obs-deploy/ping.yml
2025-11-13 15:56:45 +08:00

24 lines
596 B
YAML

- name: Check Alive
hosts: all
become: false
gather_facts: false
tasks:
- name: Ansible Ping
ansible.builtin.ping:
- name: Collect Uptime
ansible.builtin.command:
cmd: uptime
register: uptime_info
changed_when: false
- name: Collect Container Info
ansible.builtin.command:
cmd: docker ps
register: container_info
changed_when: false
- name: Print uptime
ansible.builtin.debug:
msg:
- "{{ ansible_ssh_host }}"
- "{{ uptime_info.stdout }}"
- "{{ container_info.stdout }}"