gather.yml
gather.yml added
This commit is contained in:
parent
178fc56b6a
commit
383b0a4e8f
1 changed files with 23 additions and 0 deletions
23
gather.yml
Normal file
23
gather.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
- name: Gather system information
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
|
||||
tasks:
|
||||
- name: Display Hostname
|
||||
debug:
|
||||
msg: "Hostname: {{ ansible_hostname }}"
|
||||
|
||||
- name: Display Operating System
|
||||
debug:
|
||||
msg: "Operating System: {{ ansible_distribution }} {{ ansible_distribution_version }}"
|
||||
|
||||
- name: Check CPU and total memory
|
||||
debug:
|
||||
msg: "CPU Architecture: {{ ansible_architecture }}, Total Memory: {{ ansible_memtotal_mb }} MB"
|
||||
|
||||
- name: Check disk space
|
||||
debug:
|
||||
msg: "Disk Space on /dev/sda: Total={{ (ansible_mounts[0].size_total / 1024 / 1024 / 1024) | round(2) }} GB Available={{ (ansible_mounts[0].size_available / 1024 / 1024 / 1024) }} GB"
|
||||
- name: Check network interface information
|
||||
debug:
|
||||
msg: "IP Address of eth0 is {{ ansible_facts['eth0']['ipv4']['address'] }}"
|
||||
Loading…
Reference in a new issue