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

Side by Side Diff: modules/nagios/manifests/server.pp

Issue 5114072680890368: Issue 2188 - Use class parameter lookup feature with Hiera (Closed)
Patch Set: Created March 20, 2015, 1:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 class nagios::server( 1 class nagios::server(
2 $domain, 2 $domain,
3 $certificate, 3 $certificate,
4 $private_key, 4 $private_key,
5 $is_default=false, 5 $is_default=false,
6 $htpasswd_source, 6 $htpasswd_source,
7 $admins, 7 $admins,
8 $zone, 8 $zone,
9 $contacts = hiera('nagios::server::contacts', {}),
10 $contactgroups = hiera('nagios::server::contactgroups', {}),
11 $commands = hiera('nagios::server::commands', {}),
12 $services = hiera('nagios::server::services', {}),
13 $hosts = hiera('nagios::server::hosts', {}),
14 $hostgroups = hiera('nagios::server::hostgroups', {}),
9 ) { 15 ) {
10 16
11 File { 17 File {
12 owner => 'root', 18 owner => 'root',
13 group => 'root', 19 group => 'root',
14 mode => 0644 20 mode => 0644
15 } 21 }
16 22
17 include nginx, 'spawn-fcgi' 23 include nginx, 'spawn-fcgi'
18 24
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 file {['/etc/nagios3/conf.d/contacts.cfg', 146 file {['/etc/nagios3/conf.d/contacts.cfg',
141 '/etc/nagios3/conf.d/contactgroups.cfg', 147 '/etc/nagios3/conf.d/contactgroups.cfg',
142 '/etc/nagios3/conf.d/commands.cfg', 148 '/etc/nagios3/conf.d/commands.cfg',
143 '/etc/nagios3/conf.d/hosts.cfg', 149 '/etc/nagios3/conf.d/hosts.cfg',
144 '/etc/nagios3/conf.d/hostgroups.cfg', 150 '/etc/nagios3/conf.d/hostgroups.cfg',
145 '/etc/nagios3/conf.d/services.cfg']: 151 '/etc/nagios3/conf.d/services.cfg']:
146 require => Package['nagios3'], 152 require => Package['nagios3'],
147 notify => Service['nagios3'] 153 notify => Service['nagios3']
148 } 154 }
149 155
150 $nagios_contacts = hiera('nagios_contacts', {}) 156 create_resources(nagios_contact, $contacts)
151 create_resources(nagios_contact, $nagios_contacts) 157 create_resources(nagios_contactgroup, $contactgroups)
152 158 create_resources(nagios_command, $commands)
153 $nagios_contactgroups = hiera('nagios_contactgroups', {}) 159 create_resources(nagios_service, $services)
154 create_resources(nagios_contactgroup, $nagios_contactgroups) 160 create_resources(nagios_host, $hosts)
155 161 create_resources(nagios_hostgroup, $hostgroups)
156 $nagios_commands = hiera('nagios_commands', {})
157 create_resources(nagios_command, $nagios_commands)
158
159 $nagios_services = hiera('nagios_services', {})
160 create_resources(nagios_service, $nagios_services)
161
162 $nagios_hosts = hiera('nagios_hosts', {})
163 create_resources(nagios_host, $nagios_hosts)
164
165 $nagios_hostgroups = hiera('nagios_hostgroups', {})
166 create_resources(nagios_hostgroup, $nagios_hostgroups)
167 162
168 $nagios_generic = hiera('servers') 163 $nagios_generic = hiera('servers')
169 create_resources(nagios::server::generic_host, $nagios_generic) 164 create_resources(nagios::server::generic_host, $nagios_generic)
170 165
171 define generic_host( 166 define generic_host(
172 $ip, 167 $ip,
173 $ssh_public_key = undef, 168 $ssh_public_key = undef,
174 $role = undef, 169 $role = undef,
175 $dns = undef, 170 $dns = undef,
176 $groups = [], 171 $groups = [],
177 ) { 172 ) {
178 173
179 if $dns == undef { 174 if $dns == undef {
180 $fqdn_name = join([$name, $nagios::server::zone], '.') 175 $fqdn_name = join([$name, $nagios::server::zone], '.')
181 } else { 176 } else {
182 $fqdn_name = $dns 177 $fqdn_name = $dns
183 } 178 }
184 179
185 nagios_host {$fqdn_name: 180 nagios_host {$fqdn_name:
186 use => 'generic-host', 181 use => 'generic-host',
187 hostgroups => $groups, 182 hostgroups => $groups,
188 } 183 }
189 } 184 }
190 } 185 }
OLDNEW
« no previous file with comments | « hiera/roles/monitoringserver.yaml ('k') | modules/private-stub/hiera/roles/monitoringserver.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld