-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem-info_pb.yml
46 lines (42 loc) · 1.28 KB
/
system-info_pb.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
# Playbook takes 1 variable. Run playbook with: --extra-vars="nodes=<HOST(S)>"
- name: System info
hosts: "{{ nodes }}"
tasks:
- name: hostname
debug: var=ansible_hostname
- name: date and time
vars:
msg: |
Date: {{ ansible_date_time.date }}
Timezone: {{ ansible_date_time.tz }}
debug:
msg: "{{ msg.split('\n') }}"
- name: network info
vars:
msg: |
All Interface List: {{ ansible_interfaces }}
All IP: {{ ansible_all_ipv4_addresses }}
Gateway: {{ ansible_default_ipv4.gateway }}
# Eth0 MAC: {{ ansible_eth0.macaddress }}
debug:
msg: "{{ msg.split('\n') }}"
- name: OS and Kernel info
vars:
msg: |
Distribution: {{ ansible_distribution }}
Release: {{ ansible_distribution_release }}
Distribution Version: {{ ansible_distribution_version }}
Kernel: {{ ansible_kernel }}
Architecture: {{ ansible_architecture }}
debug:
msg: "{{ msg.split('\n') }}"
- name: HW info
vars:
msg: |
CPU: {{ ansible_processor }}
CPU Core: {{ ansible_processor_cores }}
RAM: {{ ansible_memtotal_mb }}
SWAP: {{ ansible_memory_mb.swap.total }}
debug:
msg: "{{ msg.split('\n') }}"