-
-
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
355559a
commit 184f7ca
Showing
9 changed files
with
107 additions
and
128 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 |
---|---|---|
@@ -0,0 +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=[]) %} | ||
|
||
{%- if 'icinga2_server' not in tags %} | ||
object Endpoint "{{ node_id }}" { | ||
host = "{{ node_id }}" | ||
} | ||
|
||
object Zone "{{ node_id }}" { | ||
endpoints = [ "{{ node_id }}" ] | ||
parent = "master" | ||
} | ||
{%- endif %} | ||
|
||
object Host "{{ node_id }}" { | ||
import "generic-host" | ||
|
||
display_name = "{{ node_id }}" | ||
check_command = "hostalive" | ||
|
||
{%- 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 %} | ||
|
||
vars.os = "Linux" | ||
|
||
vars.role = "{{ role }}" | ||
|
||
vars.tags = [ | ||
{%- for tag in tags|sort %} | ||
"{{ tag }}", | ||
{%- endfor %} | ||
] | ||
|
||
vars.sites = [ | ||
{%- for site in sites|sort %} | ||
"{{ site }}", | ||
{%- endfor %} | ||
] | ||
|
||
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 %} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
Oops, something went wrong.