LEFT | RIGHT |
(no file at all) | |
1 class nagios::server($vhost, $htpasswd_source, $admins) { | 1 class nagios::server($domain, $is_default=false, $htpasswd_source, $admins) { |
2 File { | 2 File { |
3 owner => 'root', | 3 owner => 'root', |
4 group => 'root', | 4 group => 'root', |
5 mode => 0644 | 5 mode => 0644 |
6 } | 6 } |
7 | 7 |
8 include nginx, 'spawn-fcgi' | 8 include nginx, 'spawn-fcgi' |
9 | 9 |
10 package {['nagios3', 'nagios3-doc', 'nagios-nrpe-plugin', 'php5-cgi', | 10 package {['nagios3', 'nagios3-doc', 'nagios-nrpe-plugin', 'php5-cgi', |
11 'fcgiwrap', 'pnp4nagios']: | 11 'fcgiwrap', 'pnp4nagios']: |
12 ensure => present | 12 ensure => present |
13 } | 13 } |
14 | 14 |
15 file {'/etc/nginx/sites-enabled/default': | 15 nginx::hostconfig{$domain: |
16 ensure => absent, | 16 source => 'puppet:///modules/nagios/site.conf', |
17 require => Package['nginx'] | 17 is_default => $is_default, |
18 } | 18 certificate => 'adblockplus.org_sslcert.pem', |
19 | 19 private_key => 'adblockplus.org_sslcert.key', |
20 file {"/etc/nginx/sites-available/${vhost}": | 20 log => 'access_log_monitoring' |
21 content => template('nagios/site.erb'), | |
22 require => Package['nginx'], | |
23 notify => Service['nginx'] | |
24 } | |
25 | |
26 file {"/etc/nginx/sites-enabled/${vhost}": | |
27 ensure => link, | |
28 target => "/etc/nginx/sites-available/${vhost}", | |
29 notify => Service['nginx'] | |
30 } | |
31 | |
32 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.key': | |
33 ensure => file, | |
34 require => Package['nginx'], | |
35 source => 'puppet:///modules/private/adblockplus.org_sslcert.key' | |
36 } | |
37 | |
38 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.pem': | |
39 ensure => file, | |
40 mode => 0400, | |
41 require => Package['nginx'], | |
42 source => 'puppet:///modules/private/adblockplus.org_sslcert.pem' | |
43 } | 21 } |
44 | 22 |
45 spawn-fcgi::php-pool {'global': | 23 spawn-fcgi::php-pool {'global': |
46 ensure => present, | 24 ensure => present, |
47 socket => '/tmp/php-fastcgi.sock', | 25 socket => '/tmp/php-fastcgi.sock', |
48 children => '3' | 26 children => '3' |
49 } | 27 } |
50 | 28 |
51 service {'nagios3': | 29 service {'nagios3': |
52 ensure => running, | 30 ensure => running, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 ensure => absent | 85 ensure => absent |
108 } | 86 } |
109 | 87 |
110 resources {['nagios_contact', 'nagios_contactgroup', 'nagios_host', | 88 resources {['nagios_contact', 'nagios_contactgroup', 'nagios_host', |
111 'nagios_hostgroup', 'nagios_service']: | 89 'nagios_hostgroup', 'nagios_service']: |
112 purge => true | 90 purge => true |
113 } | 91 } |
114 | 92 |
115 Nagios_contact <| |> { | 93 Nagios_contact <| |> { |
116 target => '/etc/nagios3/conf.d/contacts.cfg', | 94 target => '/etc/nagios3/conf.d/contacts.cfg', |
| 95 require => Package['nagios3'], |
117 notify => [File['/etc/nagios3/conf.d/contacts.cfg'], Service['nagios3']] | 96 notify => [File['/etc/nagios3/conf.d/contacts.cfg'], Service['nagios3']] |
118 } | 97 } |
119 | 98 |
120 Nagios_contactgroup <| |> { | 99 Nagios_contactgroup <| |> { |
121 target => '/etc/nagios3/conf.d/contactgroups.cfg', | 100 target => '/etc/nagios3/conf.d/contactgroups.cfg', |
| 101 require => Package['nagios3'], |
122 notify => [File['/etc/nagios3/conf.d/contactgroups.cfg'], Service['nagios3']
] | 102 notify => [File['/etc/nagios3/conf.d/contactgroups.cfg'], Service['nagios3']
] |
123 } | 103 } |
124 | 104 |
125 Nagios_command <| |> { | 105 Nagios_command <| |> { |
126 target => '/etc/nagios3/conf.d/commands.cfg', | 106 target => '/etc/nagios3/conf.d/commands.cfg', |
127 notify => [File['/etc/nagios3/conf.d/commands.cfg'], Service['nagios3']], | 107 require => Package['nagios3'], |
| 108 notify => [File['/etc/nagios3/conf.d/commands.cfg'], Service['nagios3']] |
128 } | 109 } |
129 | 110 |
130 Nagios_host <| |> { | 111 Nagios_host <| |> { |
131 target => '/etc/nagios3/conf.d/hosts.cfg', | 112 target => '/etc/nagios3/conf.d/hosts.cfg', |
| 113 require => Package['nagios3'], |
132 notify => [File['/etc/nagios3/conf.d/hosts.cfg'], Service['nagios3']] | 114 notify => [File['/etc/nagios3/conf.d/hosts.cfg'], Service['nagios3']] |
133 } | 115 } |
134 | 116 |
135 Nagios_hostgroup <| |> { | 117 Nagios_hostgroup <| |> { |
136 target => '/etc/nagios3/conf.d/hostgroups.cfg', | 118 target => '/etc/nagios3/conf.d/hostgroups.cfg', |
| 119 require => Package['nagios3'], |
137 notify => [File['/etc/nagios3/conf.d/hostgroups.cfg'], Service['nagios3']] | 120 notify => [File['/etc/nagios3/conf.d/hostgroups.cfg'], Service['nagios3']] |
138 } | 121 } |
139 | 122 |
140 Nagios_service <| |> { | 123 Nagios_service <| |> { |
141 target => '/etc/nagios3/conf.d/services.cfg', | 124 target => '/etc/nagios3/conf.d/services.cfg', |
| 125 require => Package['nagios3'], |
142 notify => [File['/etc/nagios3/conf.d/services.cfg'], Service['nagios3']] | 126 notify => [File['/etc/nagios3/conf.d/services.cfg'], Service['nagios3']] |
143 } | 127 } |
144 | 128 |
145 file {['/etc/nagios3/conf.d/contacts.cfg', | 129 file {['/etc/nagios3/conf.d/contacts.cfg', |
146 '/etc/nagios3/conf.d/contactgroups.cfg', | 130 '/etc/nagios3/conf.d/contactgroups.cfg', |
147 '/etc/nagios3/conf.d/commands.cfg', | 131 '/etc/nagios3/conf.d/commands.cfg', |
148 '/etc/nagios3/conf.d/hosts.cfg', | 132 '/etc/nagios3/conf.d/hosts.cfg', |
149 '/etc/nagios3/conf.d/hostgroups.cfg', | 133 '/etc/nagios3/conf.d/hostgroups.cfg', |
150 '/etc/nagios3/conf.d/services.cfg']: | 134 '/etc/nagios3/conf.d/services.cfg']: |
151 require => Package['nagios3'], | 135 require => Package['nagios3'], |
152 notify => Service['nagios3'] | 136 notify => Service['nagios3'] |
153 } | 137 } |
154 } | 138 } |
LEFT | RIGHT |