2022-10-27 10:53:10 +00:00
|
|
|
- hosts: demo
|
2022-10-12 10:08:57 +00:00
|
|
|
gather_facts: yes
|
|
|
|
tasks:
|
|
|
|
- name: Get info
|
2022-10-25 06:26:56 +00:00
|
|
|
ansible.builtin.set_fact:
|
2022-10-12 10:08:57 +00:00
|
|
|
info:
|
|
|
|
vendor: "{{ ansible_system_vendor }}"
|
|
|
|
model: "{{ ansible_product_name }}"
|
|
|
|
sn: "{{ ansible_product_serial }}"
|
2023-02-03 10:23:38 +00:00
|
|
|
cpu_model: "{{ ansible_processor }}"
|
|
|
|
cpu_count: "{{ ansible_processor_count }}"
|
|
|
|
cpu_cores: "{{ ansible_processor_cores }}"
|
2022-10-12 10:08:57 +00:00
|
|
|
cpu_vcpus: "{{ ansible_processor_vcpus }}"
|
2023-02-28 10:45:38 +00:00
|
|
|
memory: "{{ ansible_memtotal_mb / 1024 | round(2) }}"
|
2022-10-12 10:08:57 +00:00
|
|
|
disk_total: "{{ (ansible_mounts | map(attribute='size_total') | sum / 1024 / 1024 / 1024) | round(2) }}"
|
2023-02-03 10:23:38 +00:00
|
|
|
distribution: "{{ ansible_distribution }}"
|
|
|
|
distribution_version: "{{ ansible_distribution_version }}"
|
|
|
|
arch: "{{ ansible_architecture }}"
|
|
|
|
kernel: "{{ ansible_kernel }}"
|
|
|
|
|
2022-10-12 10:08:57 +00:00
|
|
|
- debug:
|
|
|
|
var: info
|