mirror of https://github.com/jumpserver/jumpserver
fix: 主机硬件信息硬盘大小避免多次挂载重复计入
parent
4adc981a21
commit
60f7cbef9a
|
@ -12,7 +12,12 @@
|
|||
cpu_cores: "{{ ansible_processor_cores }}"
|
||||
cpu_vcpus: "{{ ansible_processor_vcpus }}"
|
||||
memory: "{{ ansible_memtotal_mb / 1024 | round(2) }}"
|
||||
disk_total: "{{ (ansible_mounts | map(attribute='size_total') | sum / 1024 / 1024 / 1024) | round(2) }}"
|
||||
disk_total: |-
|
||||
{% set ns = namespace(total=0) %}
|
||||
{%- for name, dev in ansible_devices.items() if dev.removable == '0' and dev.host != '' -%}
|
||||
{%- set ns.total = ns.total + ( dev.sectors | int * dev.sectorsize | int ) -%}
|
||||
{%- endfor -%}
|
||||
{{- (ns.total / 1024 / 1024 / 1024) | round(2) -}}
|
||||
distribution: "{{ ansible_distribution }}"
|
||||
distribution_version: "{{ ansible_distribution_version }}"
|
||||
arch: "{{ ansible_architecture }}"
|
||||
|
|
Loading…
Reference in New Issue