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

Powered by Google App Engine
This is Rietveld