feat: 1) ListGroups返回组内主机详细信息 2) 前端刷新间隔改为5分钟 3) 命令执行和Playbook页面主机组支持展开显示组内主机
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
---
|
||||
# 系统信息检查
|
||||
- name: System Information
|
||||
hosts: "{{ target_hosts | default('all') }}"
|
||||
gather_facts: yes
|
||||
|
||||
tasks:
|
||||
- name: Display OS info
|
||||
debug:
|
||||
msg: "OS: {{ ansible_facts['distribution'] }} {{ ansible_facts['distribution_version'] }}"
|
||||
|
||||
- name: Display hostname
|
||||
debug:
|
||||
msg: "Hostname: {{ ansible_facts['hostname'] }}"
|
||||
|
||||
- name: Display IP addresses
|
||||
debug:
|
||||
msg: "IP: {{ ansible_facts['default_ipv4']['address'] }}"
|
||||
|
||||
- name: Display memory info
|
||||
debug:
|
||||
msg: "Memory: {{ (ansible_facts['memtotal_mb'] / 1024) | round(2) }} GB"
|
||||
|
||||
- name: Display CPU info
|
||||
debug:
|
||||
msg: "CPU: {{ ansible_facts['processor_vcpus'] }} vCPUs"
|
||||
|
||||
- name: Display disk space
|
||||
debug:
|
||||
msg: "Disk: {{ ansible_facts['mounts'][0]['size_total'] | default(0) | int / 1024 / 1024 / 1024 | round(2) }} GB"
|
||||
|
||||
- name: Uptime
|
||||
command: uptime -s
|
||||
register: uptime
|
||||
|
||||
- name: Show uptime
|
||||
debug:
|
||||
msg: "Uptime since: {{ uptime.stdout }}"
|
||||
Reference in New Issue
Block a user