-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
184f7ca
commit 5512129
Showing
1 changed file
with
56 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} | ||
} |