lime2 and test servers don't have smart devices

This commit is contained in:
Tunui Franken 2025-03-23 23:05:25 +01:00
parent d6ada5a32a
commit 342dcdf016
4 changed files with 4 additions and 10 deletions

View file

@ -184,6 +184,3 @@ nagstamon_pwd: !vault |
35333633613530373864373530653936376532663933346431376435356665373863356461393734
6435363230366562630a636364653531366563313335303464666337356138656634373063643431
33613664333030643233303738343930376263353038653762633461646330346436
smart_devices:
- /dev/mmcblk0

View file

@ -1,6 +1,3 @@
---
ipv4_addr: 10.1.2.80
smart_devices:
- /dev/vda

View file

@ -1,7 +1,3 @@
---
ipv4_addr: 10.1.2.25
smart_devices:
- /dev/vda
- /dev/vdb

View file

@ -3,19 +3,23 @@
object Host "{{ icinga2_master }}" {
import "generic-host"
address = "{{ hostvars[icinga2_master].ipv4_addr }}"
{% if hostvars[icinga2_master].smart_devices is defined %}
{% for device in hostvars[icinga2_master].smart_devices %}
vars.smart_devices["smart::{{ device }}"] = {
smart_device = "{{ device }}"
}
{% endfor %}
{% endif %}
}
object Host "{{ icinga2_agent }}" {
import "generic-host"
address = "{{ hostvars[icinga2_agent].ipv4_addr }}"
{% if hostvars[icinga2_agent].smart_devices is defined %}
{% for device in hostvars[icinga2_agent].smart_devices %}
vars.smart_devices["smart::{{ device }}"] = {
smart_device = "{{ device }}"
}
{% endfor %}
{% endif %}
}