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

Unified Diff: modules/filterserver/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/filterserver/manifests/init.pp
===================================================================
--- a/modules/filterserver/manifests/init.pp
+++ b/modules/filterserver/manifests/init.pp
@@ -1,13 +1,24 @@
-class filterserver {
- class {'nginx':
- worker_processes => 2,
- worker_connections => 4000,
- ssl_session_cache => off,
+class filterserver($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']
+ }
}
user {'subscriptionstat':
ensure => absent,
}
user {'rsync':
ensure => present,
@@ -17,26 +28,18 @@ class filterserver {
}
File {
owner => root,
group => root,
mode => 0644,
}
- file {'/var/www':
- ensure => directory
- }
-
file {'/var/www/easylist':
ensure => directory,
- require => [
- File['/var/www'],
- User['rsync']
- ],
owner => rsync
}
file {'/etc/nginx/sites-available/inc.easylist-downloads':
ensure => absent,
}
file {'/etc/nginx/sites-available/inc.easylist-downloads-txt':
@@ -58,17 +61,17 @@ class filterserver {
ensure => file,
notify => Service['nginx'],
before => Nginx::Hostconfig['easylist-downloads.adblockplus.org'],
mode => 0400,
source => 'puppet:///modules/private/easylist-downloads.adblockplus.org_sslcert.pem'
}
nginx::hostconfig{'easylist-downloads.adblockplus.org':
- source => 'puppet:///modules/filterserver/easylist-downloads.adblockplus.org',
+ content => template('filterserver/easylist-downloads.adblockplus.org.erb'),
enabled => true
}
file {'/etc/logrotate.d/nginx_easylist-downloads.adblockplus.org':
ensure => file,
require => Nginx::Hostconfig['easylist-downloads.adblockplus.org'],
source => 'puppet:///modules/filterserver/logrotate'
}
@@ -80,27 +83,26 @@ class filterserver {
mode => 0600;
}
concat {'/home/rsync/.ssh/known_hosts':
owner => rsync,
mode => 0444,
}
-
concat::fragment {'filtermaster_hostname':
- target => '/home/rsync/.ssh/known_hosts',
- content => 'filtermaster.adblockplus.org ',
- order => 1,
+ target => '/home/rsync/.ssh/known_hosts',
+ content => 'filtermaster.adblockplus.org ',
+ order => 1,
}
- concat::fragment {'filtermaster_hostkey':
- target => '/home/rsync/.ssh/known_hosts',
- source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub',
- order => 2,
+ concat::fragment {'filtermaster_hostkey':
+ target => '/home/rsync/.ssh/known_hosts',
+ source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub',
+ order => 2,
}
file {'/home/rsync/.ssh/id_rsa':
ensure => file,
require => [
File['/home/rsync/.ssh'],
User['rsync']
],

Powered by Google App Engine
This is Rietveld