| Index: modules/notificationserver/manifests/init.pp |
| =================================================================== |
| --- a/modules/notificationserver/manifests/init.pp |
| +++ b/modules/notificationserver/manifests/init.pp |
| @@ -1,26 +1,30 @@ |
| -class notificationserver { |
| - class {'nginx': |
| - worker_processes => 2, |
| - worker_connections => 4000, |
| - ssl_session_cache => off, |
| +class notificationserver($is_default = false) { |
| + if !defined(Class['nginx']) { |
| + class {'nginx': |
| + worker_processes => 2, |
| + worker_connections => 4000, |
| + ssl_session_cache => off, |
| + } |
| + } |
| + |
| + if !defined(File['/var/www']) { |
| + file {'/var/www': |
| + ensure => directory, |
| + owner => nginx, |
| + mode => 0755, |
| + require => Package['nginx'] |
| + } |
| } |
| class {'sitescripts': |
| sitescriptsini_source => 'puppet:///modules/notificationserver/sitescripts.ini' |
| } |
| - file {'/var/www': |
| - ensure => directory, |
| - owner => nginx, |
| - mode => 0755, |
| - require => Package['nginx'] |
| - } |
| - |
| file {'/var/www/notification': |
| ensure => directory, |
| owner => nginx, |
| mode => 0755, |
| require => Package['nginx'] |
| } |
| exec { "fetch_notifications": |
| @@ -63,17 +67,17 @@ class notificationserver { |
| ensure => file, |
| notify => Service['nginx'], |
| before => Nginx::Hostconfig['notification.adblockplus.org'], |
| mode => 0400, |
| source => 'puppet:///modules/private/adblockplus.org_sslcert.pem' |
| } |
| nginx::hostconfig{'notification.adblockplus.org': |
| - source => 'puppet:///modules/notificationserver/notification.adblockplus.org', |
| + content => template('notificationserver/notification.adblockplus.org.erb'), |
| enabled => true |
| } |
| file {'/etc/logrotate.d/nginx_notification.adblockplus.org': |
| ensure => file, |
| mode => 0444, |
| require => Nginx::Hostconfig['notification.adblockplus.org'], |
| source => 'puppet:///modules/notificationserver/logrotate' |