From 55121294f8d9339c8c35f4d6320706a072db8685 Mon Sep 17 00:00:00 2001 From: DasSkelett Date: Thu, 3 Oct 2024 14:35:29 +0200 Subject: [PATCH] Fix indentation --- icinga2/host.conf.jinja | 112 ++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/icinga2/host.conf.jinja b/icinga2/host.conf.jinja index aa254e9..48e78db 100644 --- a/icinga2/host.conf.jinja +++ b/icinga2/host.conf.jinja @@ -1,69 +1,69 @@ - # - # {{ node_id }} - # - {%- set role = salt['mine.get'](node_id,'minion_role')[node_id] %} - {%- set tags = salt['mine.get'](node_id,'minion_tags')[node_id] %} - {%- set location = salt['mine.get'](node_id,'minion_location', tgt_type='glob')[node_id] %} - {%- set overlay_address = salt['mine.get'](node_id,'minion_overlay_address', tgt_type='glob')[node_id] %} - {%- set minion_external_address6 = salt['mine.get'](node_id,'minion_external_ip6', tgt_type='glob')[node_id] %} - {%- set sites = salt['pillar.get']('netbox:config_context:sites').values()|sum(start=[]) %} +# +# {{ node_id }} +# +{%- set role = salt['mine.get'](node_id,'minion_role')[node_id] %} +{%- set tags = salt['mine.get'](node_id,'minion_tags')[node_id] %} +{%- set location = salt['mine.get'](node_id,'minion_location', tgt_type='glob')[node_id] %} +{%- set overlay_address = salt['mine.get'](node_id,'minion_overlay_address', tgt_type='glob')[node_id] %} +{%- set minion_external_address6 = salt['mine.get'](node_id,'minion_external_ip6', tgt_type='glob')[node_id] %} +{%- set sites = salt['pillar.get']('netbox:config_context:sites').values()|sum(start=[]) %} - {%- if 'icinga2_server' not in tags %} - object Endpoint "{{ node_id }}" { - host = "{{ node_id }}" - } +{%- if 'icinga2_server' not in tags %} +object Endpoint "{{ node_id }}" { + host = "{{ node_id }}" +} - object Zone "{{ node_id }}" { - endpoints = [ "{{ node_id }}" ] - parent = "master" - } - {%- endif %} +object Zone "{{ node_id }}" { + endpoints = [ "{{ node_id }}" ] + parent = "master" +} +{%- endif %} - object Host "{{ node_id }}" { - import "generic-host" +object Host "{{ node_id }}" { + import "generic-host" - display_name = "{{ node_id }}" - check_command = "hostalive" + display_name = "{{ node_id }}" + check_command = "hostalive" - {%- if 'mine_interval' not in overlay_address %} - address = "{{ overlay_address | regex_replace('/\d+$','') }}" - {%- endif %} + {%- if 'mine_interval' not in overlay_address %} + address = "{{ overlay_address | regex_replace('/\d+$','') }}" + {%- endif %} - {%- if minion_external_address6 %} - # Used to determine whether a host has IPv6 - vars.external_address_6 = "{{ minion_external_address6 }}" - {%- endif %} + {%- if minion_external_address6 %} + # Used to determine whether a host has IPv6 + vars.external_address_6 = "{{ minion_external_address6 }}" + {%- endif %} - vars.os = "Linux" + vars.os = "Linux" - vars.role = "{{ role }}" + vars.role = "{{ role }}" - vars.tags = [ - {%- for tag in tags|sort %} - "{{ tag }}", - {%- endfor %} - ] + vars.tags = [ + {%- for tag in tags|sort %} + "{{ tag }}", + {%- endfor %} + ] - vars.sites = [ - {%- for site in sites|sort %} - "{{ site }}", - {%- endfor %} - ] + vars.sites = [ + {%- for site in sites|sort %} + "{{ site }}", + {%- endfor %} + ] - vars.location = "{{ location }}" + vars.location = "{{ location }}" - vars.disk_wfree = "4%" - vars.disk_cfree = "2%" - vars.disks["disk /"] = { - disk_partitions = "/" - } - {% if 'backupserver' == role %} - vars.disks["disk /srv"] = { - disk_partitions = "/srv" - } - {% elif 'buildserver' == role %} - vars.disks["disk /build"] = { - disk_partitions = "/build" - } - {% endif %} + vars.disk_wfree = "4%" + vars.disk_cfree = "2%" + vars.disks["disk /"] = { + disk_partitions = "/" + } + {% if 'backupserver' == role %} + vars.disks["disk /srv"] = { + disk_partitions = "/srv" + } + {% elif 'buildserver' == role %} + vars.disks["disk /build"] = { + disk_partitions = "/build" } + {% endif %} +}