-
Notifications
You must be signed in to change notification settings - Fork 7
/
hwreport.yml
61 lines (50 loc) · 1.63 KB
/
hwreport.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- hosts: all
#become: true
#remote_user: vagrant
tasks:
- name: Create hwreport.empty file
shell: 'touch /tmp/hwreport.empty'
- name: Copy hwreport.empty file
src: /tmp/hwreport.empty
dest: /root/hwreport.txt
force: yes
- name: replace hostname in hwreport
replace:
path: /root/hwreport.txt
regexp: "inventoryhostname"
replace: "{{ ansible_hostname }}"
- name: replace totalmemory in hwreport
replace:
path: /root/hwreport.txt
regexp: "total_memory"
replace: "{{ ansible_memtotal_mb }}"
- name: replace bios_version in hwreport
replace:
path: /root/hwreport.txt
regexp: "bios_version"
replace: "{{ ansible_bios_version }}"
- name: replace SDA Size in hwreport
replace:
path: /root/hwreport.txt
regexp: "sda_size"
replace: "{{ ansible_devices.sda.size }}"
when: ansible_devices.sda.size is defined
- name: replace SDA Size, NONE when size is not find in hwreport
replace:
path: /root/hwreport.txt
regexp: "sda_size"
replace: "NONE"
when: ansible_devices.sda.size is not defined
- name: replace SDB Size in hwreport
replace:
path: /root/hwreport.txt
regexp: "sdb_size"
replace: "{{ ansible_devices.sdb.size }}"
when: ansible_devices.sdb.size is defined
- name: replace NONE, when SDB Size is not find in hwreport
replace:
path: /root/hwreport.txt
regexp: "sdb_size"
replace: "NONE"
when: ansible_devices.sdb.size is not defined