Index: modules/nagios/manifests/server.pp |
=================================================================== |
--- a/modules/nagios/manifests/server.pp |
+++ b/modules/nagios/manifests/server.pp |
@@ -1,50 +1,28 @@ |
-class nagios::server($vhost, $htpasswd_source, $admins) { |
+class nagios::server($domain, $is_default=false, $htpasswd_source, $admins) { |
File { |
owner => 'root', |
group => 'root', |
mode => 0644 |
} |
include nginx, 'spawn-fcgi' |
package {['nagios3', 'nagios3-doc', 'nagios-nrpe-plugin', 'php5-cgi', |
'fcgiwrap', 'pnp4nagios']: |
ensure => present |
} |
- file {'/etc/nginx/sites-enabled/default': |
- ensure => absent, |
- require => Package['nginx'] |
- } |
- |
- file {"/etc/nginx/sites-available/${vhost}": |
- content => template('nagios/site.erb'), |
- require => Package['nginx'], |
- notify => Service['nginx'] |
- } |
- |
- file {"/etc/nginx/sites-enabled/${vhost}": |
- ensure => link, |
- target => "/etc/nginx/sites-available/${vhost}", |
- notify => Service['nginx'] |
- } |
- |
- file {'/etc/nginx/sites-available/adblockplus.org_sslcert.key': |
- ensure => file, |
- require => Package['nginx'], |
- source => 'puppet:///modules/private/adblockplus.org_sslcert.key' |
- } |
- |
- file {'/etc/nginx/sites-available/adblockplus.org_sslcert.pem': |
- ensure => file, |
- mode => 0400, |
- require => Package['nginx'], |
- source => 'puppet:///modules/private/adblockplus.org_sslcert.pem' |
+ nginx::hostconfig{$domain: |
+ source => 'puppet:///modules/nagios/site.conf', |
+ is_default => $is_default, |
+ certificate => 'adblockplus.org_sslcert.pem', |
+ private_key => 'adblockplus.org_sslcert.key', |
+ log => 'access_log_monitoring' |
} |
spawn-fcgi::php-pool {'global': |
ensure => present, |
socket => '/tmp/php-fastcgi.sock', |
children => '3' |
} |
@@ -109,41 +87,47 @@ class nagios::server($vhost, $htpasswd_s |
resources {['nagios_contact', 'nagios_contactgroup', 'nagios_host', |
'nagios_hostgroup', 'nagios_service']: |
purge => true |
} |
Nagios_contact <| |> { |
target => '/etc/nagios3/conf.d/contacts.cfg', |
+ require => Package['nagios3'], |
notify => [File['/etc/nagios3/conf.d/contacts.cfg'], Service['nagios3']] |
} |
Nagios_contactgroup <| |> { |
target => '/etc/nagios3/conf.d/contactgroups.cfg', |
+ require => Package['nagios3'], |
notify => [File['/etc/nagios3/conf.d/contactgroups.cfg'], Service['nagios3']] |
} |
Nagios_command <| |> { |
target => '/etc/nagios3/conf.d/commands.cfg', |
- notify => [File['/etc/nagios3/conf.d/commands.cfg'], Service['nagios3']], |
+ require => Package['nagios3'], |
+ notify => [File['/etc/nagios3/conf.d/commands.cfg'], Service['nagios3']] |
} |
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'], |
notify => [File['/etc/nagios3/conf.d/hostgroups.cfg'], Service['nagios3']] |
} |
Nagios_service <| |> { |
target => '/etc/nagios3/conf.d/services.cfg', |
+ require => Package['nagios3'], |
notify => [File['/etc/nagios3/conf.d/services.cfg'], Service['nagios3']] |
} |
file {['/etc/nagios3/conf.d/contacts.cfg', |
'/etc/nagios3/conf.d/contactgroups.cfg', |
'/etc/nagios3/conf.d/commands.cfg', |
'/etc/nagios3/conf.d/hosts.cfg', |
'/etc/nagios3/conf.d/hostgroups.cfg', |