Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DasSkelett committed Oct 3, 2024
1 parent 184f7ca commit 5512129
Showing 1 changed file with 56 additions and 56 deletions.
112 changes: 56 additions & 56 deletions icinga2/host.conf.jinja
Original file line number Diff line number Diff line change
@@ -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 %}
}

0 comments on commit 5512129

Please sign in to comment.