Browse Source

Icinga2: Migrate to get_primary_ip() function.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 3 years ago
parent
commit
96e4390954
1 changed files with 2 additions and 7 deletions
  1. 2 7
      icinga2/host.conf.tmpl

+ 2 - 7
icinga2/host.conf.tmpl

@@ -3,13 +3,8 @@
 #
 {%- set roles = node_config.get ('roles', []) %}
 {%- set sites = node_config.get ('sites', []) %}
-{%- if node_config.get ('primary_ips', False) %}
-  {%- set address = node_config['primary_ips'].get ('v4', '') %}
-  {%- set address6 = node_config['primary_ips'].get ('v6', '') %}
-{%- else %}
-  {%- set address = salt['ffho_net.get_loopback_ip'] (node_config, node_id, 'v4') %}
-  {%- set address6 = salt['ffho_net.get_loopback_ip'] (node_config, node_id, 'v6') %}
-{%- endif %}
+{%- set address = salt['ffho_net.get_primary_ip'] (node_config, 'v4').ip %}
+{%- set address6 = salt['ffho_net.get_primary_ip'] (node_config, 'v6').ip %}
 {%- set monitoring_config = node_config.get ('monitoring', {}) %}
 {%- set status = node_config.get ('status', 'active') %}