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

Unified Diff: modules/notificationserver/manifests/init.pp

Issue 5302563972841472: Merge filter and notification servers, have both tasks run on the same servers (Closed)
Patch Set: Stopped misusing is_default parameter Created Jan. 30, 2014, 2:10 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
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'

Powered by Google App Engine
This is Rietveld