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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 class filterserver { 1 class filterserver($is_default = false) {
2 class {'nginx': 2 if !defined(Class['nginx']) {
3 worker_processes => 2, 3 class {'nginx':
4 worker_connections => 4000, 4 worker_processes => 2,
5 ssl_session_cache => off, 5 worker_connections => 4000,
6 ssl_session_cache => off,
7 }
8 }
9
10 if !defined(File['/var/www']) {
11 file {'/var/www':
12 ensure => directory,
13 owner => nginx,
14 mode => 0755,
15 require => Package['nginx']
16 }
6 } 17 }
7 18
8 user {'subscriptionstat': 19 user {'subscriptionstat':
9 ensure => absent, 20 ensure => absent,
10 } 21 }
11 22
12 user {'rsync': 23 user {'rsync':
13 ensure => present, 24 ensure => present,
14 comment => 'Filter list mirror user', 25 comment => 'Filter list mirror user',
15 home => '/home/rsync', 26 home => '/home/rsync',
16 managehome => true 27 managehome => true
17 } 28 }
18 29
19 File { 30 File {
20 owner => root, 31 owner => root,
21 group => root, 32 group => root,
22 mode => 0644, 33 mode => 0644,
23 } 34 }
24 35
25 file {'/var/www':
26 ensure => directory
27 }
28
29 file {'/var/www/easylist': 36 file {'/var/www/easylist':
30 ensure => directory, 37 ensure => directory,
31 require => [
32 File['/var/www'],
33 User['rsync']
34 ],
35 owner => rsync 38 owner => rsync
36 } 39 }
37 40
38 file {'/etc/nginx/sites-available/inc.easylist-downloads': 41 file {'/etc/nginx/sites-available/inc.easylist-downloads':
39 ensure => absent, 42 ensure => absent,
40 } 43 }
41 44
42 file {'/etc/nginx/sites-available/inc.easylist-downloads-txt': 45 file {'/etc/nginx/sites-available/inc.easylist-downloads-txt':
43 ensure => absent 46 ensure => absent
44 } 47 }
(...skipping 11 matching lines...) Expand all
56 59
57 file {'/etc/nginx/sites-available/easylist-downloads.adblockplus.org_sslcert.p em': 60 file {'/etc/nginx/sites-available/easylist-downloads.adblockplus.org_sslcert.p em':
58 ensure => file, 61 ensure => file,
59 notify => Service['nginx'], 62 notify => Service['nginx'],
60 before => Nginx::Hostconfig['easylist-downloads.adblockplus.org'], 63 before => Nginx::Hostconfig['easylist-downloads.adblockplus.org'],
61 mode => 0400, 64 mode => 0400,
62 source => 'puppet:///modules/private/easylist-downloads.adblockplus.org_sslc ert.pem' 65 source => 'puppet:///modules/private/easylist-downloads.adblockplus.org_sslc ert.pem'
63 } 66 }
64 67
65 nginx::hostconfig{'easylist-downloads.adblockplus.org': 68 nginx::hostconfig{'easylist-downloads.adblockplus.org':
66 source => 'puppet:///modules/filterserver/easylist-downloads.adblockplus.org ', 69 content => template('filterserver/easylist-downloads.adblockplus.org.erb'),
67 enabled => true 70 enabled => true
68 } 71 }
69 72
70 file {'/etc/logrotate.d/nginx_easylist-downloads.adblockplus.org': 73 file {'/etc/logrotate.d/nginx_easylist-downloads.adblockplus.org':
71 ensure => file, 74 ensure => file,
72 require => Nginx::Hostconfig['easylist-downloads.adblockplus.org'], 75 require => Nginx::Hostconfig['easylist-downloads.adblockplus.org'],
73 source => 'puppet:///modules/filterserver/logrotate' 76 source => 'puppet:///modules/filterserver/logrotate'
74 } 77 }
75 78
76 file {'/home/rsync/.ssh': 79 file {'/home/rsync/.ssh':
77 ensure => directory, 80 ensure => directory,
78 require => User['rsync'], 81 require => User['rsync'],
79 owner => rsync, 82 owner => rsync,
80 mode => 0600; 83 mode => 0600;
81 } 84 }
82 85
83 concat {'/home/rsync/.ssh/known_hosts': 86 concat {'/home/rsync/.ssh/known_hosts':
84 owner => rsync, 87 owner => rsync,
85 mode => 0444, 88 mode => 0444,
86 } 89 }
87 90
88
89 concat::fragment {'filtermaster_hostname': 91 concat::fragment {'filtermaster_hostname':
90 target => '/home/rsync/.ssh/known_hosts', 92 target => '/home/rsync/.ssh/known_hosts',
91 content => 'filtermaster.adblockplus.org ', 93 content => 'filtermaster.adblockplus.org ',
92 order => 1, 94 order => 1,
93 } 95 }
94 96
95 concat::fragment {'filtermaster_hostkey': 97 concat::fragment {'filtermaster_hostkey':
96 target => '/home/rsync/.ssh/known_hosts', 98 target => '/home/rsync/.ssh/known_hosts',
97 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub', 99 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub',
98 order => 2, 100 order => 2,
99 } 101 }
100 102
101 file {'/home/rsync/.ssh/id_rsa': 103 file {'/home/rsync/.ssh/id_rsa':
102 ensure => file, 104 ensure => file,
103 require => [ 105 require => [
104 File['/home/rsync/.ssh'], 106 File['/home/rsync/.ssh'],
105 User['rsync'] 107 User['rsync']
106 ], 108 ],
107 owner => rsync, 109 owner => rsync,
108 mode => 0400, 110 mode => 0400,
(...skipping 18 matching lines...) Expand all
127 File['/home/rsync/.ssh/id_rsa'], 129 File['/home/rsync/.ssh/id_rsa'],
128 User['rsync'] 130 User['rsync']
129 ], 131 ],
130 command => 'rsync -e "ssh -o CheckHostIP=no" -ltprz --delete rsync@filtermas ter.adblockplus.org:. /var/www/easylist/', 132 command => 'rsync -e "ssh -o CheckHostIP=no" -ltprz --delete rsync@filtermas ter.adblockplus.org:. /var/www/easylist/',
131 environment => ['MAILTO=admins@adblockplus.org,root'], 133 environment => ['MAILTO=admins@adblockplus.org,root'],
132 user => rsync, 134 user => rsync,
133 hour => '*', 135 hour => '*',
134 minute => '2-52/10' 136 minute => '2-52/10'
135 } 137 }
136 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld