|
125 | 125 | - name: find possibly extraneous munin checks (hwmon wildcard)
|
126 | 126 | find:
|
127 | 127 | paths: /etc/munin/plugins
|
| 128 | + file_type: any |
128 | 129 | patterns:
|
129 | 130 | - sensors_*
|
130 |
| - file_type: link |
131 | 131 | register: munin_plugins_to_possibly_delete_hwmon
|
132 | 132 |
|
133 | 133 | - name: find disk devices
|
134 | 134 | find:
|
135 | 135 | paths: /dev
|
| 136 | + file_type: any |
136 | 137 | patterns: [ sda, sdb, sdc, sdd, sde, sdf, sdg, sdh, sdi, sdj, sdk, sdl, sdm, sdn, sdo, sdp, nvme0n1, nvme0n2 ]
|
137 | 138 | register: disk_devices
|
138 | 139 |
|
139 | 140 | - name: find extraneous munin checks (ntp wildcards and list)
|
140 | 141 | find:
|
141 | 142 | paths: /etc/munin/plugins
|
| 143 | + file_type: any |
142 | 144 | patterns: "{{ remove_munin_plugins }}"
|
143 |
| - file_type: link |
144 | 145 | register: munin_plugins_to_delete
|
145 | 146 |
|
146 | 147 | - name: remove extraneous munin checks (ntp wildcards and list)
|
|
160 | 161 | notify: restart munin-node
|
161 | 162 | when: not hwmon0.stat.exists
|
162 | 163 |
|
163 |
| -- name: remove extraneous munin plugins (virtual machines, containers) |
| 164 | +- name: remove extraneous munin plugins without params (pi or non virtual nor container; ie, physical machines including pi) |
164 | 165 | file:
|
165 | 166 | path: "/etc/munin/plugins/{{ item }}"
|
166 | 167 | state: absent
|
167 | 168 | become: true
|
168 |
| - with_items: "{{ physical_machine_munin_plugins }}" |
169 |
| - when: host_is_container | default(false) or host_is_virtual | default(false) or host_is_pi | default(false) |
| 169 | + with_items: "{{ pi_or_non_virtual_nor_container_munin_plugins }}" |
| 170 | + when: not (host_is_pi | default(false) or not ( host_is_container | default(false) or host_is_virtual | default(false) ) ) |
170 | 171 | notify: restart munin-node
|
171 | 172 |
|
172 |
| -- name: remove monitoring plugins not used in containers |
| 173 | +- name: remove extraneous munin plugins without params (non virtual nor container nor pi; ie, physical machines but not including pi) |
173 | 174 | file:
|
174 | 175 | path: "/etc/munin/plugins/{{ item }}"
|
175 | 176 | state: absent
|
176 | 177 | become: true
|
177 |
| - with_items: "{{ non_container_custom_munin_plugins_with_args }}" |
178 |
| - when: host_is_container | default(false) |
| 178 | + with_items: "{{ non_virtual_nor_container_nor_pi_munin_plugins }}" |
| 179 | + when: host_is_container | default(false) or host_is_virtual | default(false) or host_is_pi | default(false) |
179 | 180 | notify: restart munin-node
|
180 | 181 |
|
181 | 182 | - name: remove monitoring plugins not used in containers with params
|
|
223 | 224 | when: host_is_container | default(false)
|
224 | 225 | notify: restart munin-node
|
225 | 226 |
|
226 |
| -- name: remove existing munin plugins without params |
| 227 | +- name: remove existing munin plugins without params (non containers) |
227 | 228 | file:
|
228 |
| - path: "/etc/munin/plugins/{{ item.src }}" |
| 229 | + path: "/etc/munin/plugins/{{ item }}" |
229 | 230 | state: absent
|
230 | 231 | become: true
|
231 | 232 | with_items: "{{ non_container_munin_plugins }}"
|
|
337 | 338 | with_items: "{{ munin_plugins }}"
|
338 | 339 | notify: restart munin-node
|
339 | 340 |
|
340 |
| -- name: existing munin plugins without params (non containers) |
| 341 | +- name: install existing munin plugins without params (non containers) |
341 | 342 | file:
|
342 | 343 | src: "/usr/share/munin/plugins/{{ item }}"
|
343 | 344 | dest: "/etc/munin/plugins/{{ item }}"
|
|
347 | 348 | when: not (host_is_container | default(false))
|
348 | 349 | notify: restart munin-node
|
349 | 350 |
|
350 |
| -- name: existing munin plugins without params (physical machines) |
| 351 | +- name: enable existing munin plugins without params (pi or non virtual nor container; ie, physical machines including pi) |
| 352 | + file: |
| 353 | + src: "/usr/share/munin/plugins/{{ item }}" |
| 354 | + dest: "/etc/munin/plugins/{{ item }}" |
| 355 | + state: link |
| 356 | + become: true |
| 357 | + with_items: "{{ pi_or_non_virtual_nor_container_munin_plugins }}" |
| 358 | + when: host_is_pi | default(false) or not ( host_is_container | default(false) or host_is_virtual | default(false) ) |
| 359 | + notify: restart munin-node |
| 360 | + |
| 361 | +- name: enable existing munin plugins without params (non virtual nor container nor pi; ie, physical machines but not including pi) |
351 | 362 | file:
|
352 | 363 | src: "/usr/share/munin/plugins/{{ item }}"
|
353 | 364 | dest: "/etc/munin/plugins/{{ item }}"
|
354 | 365 | state: link
|
355 | 366 | become: true
|
356 |
| - with_items: "{{ physical_machine_munin_plugins }}" |
| 367 | + with_items: "{{ non_virtual_nor_container_nor_pi_munin_plugins }}" |
357 | 368 | when: not ( host_is_container | default(false) or host_is_virtual | default(false) or host_is_pi | default(false) )
|
358 | 369 | notify: restart munin-node
|
359 | 370 |
|
|
0 commit comments