first commit

This commit is contained in:
Ryan Cuda
2026-01-25 08:31:56 -07:00
commit 1234ef51c0
57 changed files with 2560 additions and 0 deletions

49
solutions/hwreport.yml Normal file
View 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' }}