first commit
This commit is contained in:
49
solutions/hwreport.yml
Normal file
49
solutions/hwreport.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
- name: Generate hardware report
|
||||
hosts: all
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Download empty hwreport file
|
||||
get_url:
|
||||
url: http://utility.lab.example.com/files/hwreport.empty
|
||||
dest: /root/hwreport.txt
|
||||
mode: '0644'
|
||||
|
||||
- name: Set hostname
|
||||
lineinfile:
|
||||
path: /root/hwreport.txt
|
||||
regexp: '^HOST='
|
||||
line: "HOST={{ ansible_hostname }}"
|
||||
|
||||
- name: Set BIOS version
|
||||
lineinfile:
|
||||
path: /root/hwreport.txt
|
||||
regexp: '^BIOS='
|
||||
line: "BIOS={{ ansible_bios_version | default('NONE') }}"
|
||||
|
||||
- name: Set memory size
|
||||
lineinfile:
|
||||
path: /root/hwreport.txt
|
||||
regexp: '^MEMORY='
|
||||
line: "MEMORY={{ ansible_memtotal_mb }} MB"
|
||||
|
||||
- name: Set vdb disk size
|
||||
lineinfile:
|
||||
path: /root/hwreport.txt
|
||||
regexp: '^VDB='
|
||||
line: "VDB={{ ansible_devices.vdb.size | default('NONE') }}"
|
||||
|
||||
- name: Set vdc disk size
|
||||
lineinfile:
|
||||
path: /root/hwreport.txt
|
||||
regexp: '^VDC='
|
||||
line: "VDC={{ ansible_devices.vdc.size | default('NONE') }}"
|
||||
|
||||
- name: Set vdd disk size (NONE if missing)
|
||||
lineinfile:
|
||||
path: /root/hwreport.txt
|
||||
regexp: '^VDD='
|
||||
line: >-
|
||||
VDD={{ ansible_devices.vdd.size if 'vdd' in ansible_devices else 'NONE' }}
|
||||
|
||||
Reference in New Issue
Block a user