Browse Source

icinga2: Allow setting of Host vars from pillar.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 4 years ago
parent
commit
f9b4fe7c57
1 changed files with 9 additions and 0 deletions
  1. 9 0
      icinga2/host.conf.tmpl

+ 9 - 0
icinga2/host.conf.tmpl

@@ -52,8 +52,17 @@ object Host "{{ node_id }}" {
 {%- endfor %}
 	]
 
+{%- if 'host_vars' in monitoring_config %}
+
+	# Host vars for node
+  {%- for key, value in monitoring_config.get ('host_vars').items ()|sort %}
+	vars.{{ key }} = "{{ value }}"
+  {%- endfor %}
+
+{%- endif %}
 {%- if 'service_param' in monitoring_config %}
 
+	# Service params
 	vars.service_param = {
   {%- for service, params in monitoring_config.get ('service_param').items ()|sort %}
 		"{{ service }}" = {