Files
homelab/ansible/playbooks/test.yml
2025-11-19 09:36:59 -08:00

25 lines
636 B
YAML
Executable File

---
- name: Test Ansible Playbook
hosts: all
gather_facts: yes
become: false
tasks:
- name: Ping all hosts
ansible.builtin.ping:
- name: Display hostname
ansible.builtin.debug:
msg: "The hostname of this system is {{ inventory_hostname }}"
- name: Show OS distribution
ansible.builtin.debug:
msg: "This host is running {{ ansible_distribution }} {{ ansible_distribution_version }}"
- name: Run uptime command
ansible.builtin.command: uptime
register: uptime_result
- name: Display uptime result
ansible.builtin.debug:
var: uptime_result.stdout