Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/nagios/manifests/server.pp

Issue 4810150141493248: Issue 122 - Puppet ENC via Hiera (Closed)
Patch Set: Puppet ENC via Hiera - Without Arrow Alignment Created March 16, 2015, 2:04 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/filtermaster/manifests/init.pp ('k') | modules/private-stub/hiera/base.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/nagios/manifests/server.pp
===================================================================
--- a/modules/nagios/manifests/server.pp
+++ b/modules/nagios/manifests/server.pp
@@ -4,7 +4,8 @@
$private_key,
$is_default=false,
$htpasswd_source,
- $admins
+ $admins,
+ $zone,
) {
File {
@@ -121,10 +122,9 @@
Nagios_host <| |> {
target => '/etc/nagios3/conf.d/hosts.cfg',
- require => Package['nagios3'],
notify => [File['/etc/nagios3/conf.d/hosts.cfg'], Service['nagios3']]
}
-
+ <-
Nagios_hostgroup <| |> {
target => '/etc/nagios3/conf.d/hostgroups.cfg',
require => Package['nagios3'],
@@ -146,4 +146,41 @@
require => Package['nagios3'],
notify => Service['nagios3']
}
+
+ $nagios_contacts = hiera('nagios_contacts', {})
+ create_resources(nagios_contact, $nagios_contacts)
+
+ $nagios_contactgroups = hiera('nagios_contactgroups', {})
+ create_resources(nagios_contactgroup, $nagios_contactgroups)
+
+ $nagios_commands = hiera('nagios_commands', {})
+ create_resources(nagios_command, $nagios_commands)
+
+ $nagios_services = hiera('nagios_services', {})
+ create_resources(nagios_service, $nagios_services)
+
+ $nagios_hosts = hiera('nagios_hosts', {})
+ create_resources(nagios_host, $nagios_hosts)
+
+ $nagios_hostgroups = hiera('nagios_hostgroups', {})
+ create_resources(nagios_hostgroup, $nagios_hostgroups)
+
+ $nagios_generic = hiera('servers')
+ create_resources(nagios::server::generic_host, $nagios_generic)
+
+ define generic_host(
+ $ip,
+ $ssh_public_key = undef,
+ $role = undef,
+ $dns = undef,
+ $groups = [],
+ ) {
+
+ $fqdn_name = join([$name, $nagios::server::zone], '.')
+
+ nagios_host {$fqdn_name:
+ use => 'generic-host',
+ hostgroups => $groups,
+ }
+ }
}
« no previous file with comments | « modules/filtermaster/manifests/init.pp ('k') | modules/private-stub/hiera/base.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld