OLD | NEW |
1 class filtermaster { | 1 class filtermaster { |
2 Cron { | 2 Cron { |
3 environment => ['MAILTO=admin@adblockplus.org', 'PYTHONPATH=/opt/sitescripts
'], | 3 environment => ['MAILTO=admin@adblockplus.org', 'PYTHONPATH=/opt/sitescripts
'], |
4 } | 4 } |
5 | 5 |
6 class {'ssh': | 6 class {'ssh': |
7 custom_configuration => 'Match User rsync | 7 custom_configuration => ' |
8 AllowTcpForwarding no | 8 MaxSessions 50 |
9 X11Forwarding no | 9 MaxStartups 50 |
10 AllowAgentForwarding no | 10 |
11 GatewayPorts no | 11 Match User rsync |
12 ForceCommand rsync --server --sender -vltprz --delete-excluded . /home/rsync
/generated/data/' | 12 AllowTcpForwarding no |
| 13 X11Forwarding no |
| 14 AllowAgentForwarding no |
| 15 GatewayPorts no |
| 16 ForceCommand rsync --server --sender -vltprz --delete-excluded . /home/rsy
nc/generated/data/' |
13 } | 17 } |
14 | 18 |
15 user {'rsync': | 19 user {'rsync': |
16 ensure => present, | 20 ensure => present, |
17 comment => 'Filter list mirror user', | 21 comment => 'Filter list mirror user', |
18 home => '/home/rsync', | 22 home => '/home/rsync', |
19 managehome => true | 23 managehome => true |
20 } | 24 } |
21 | 25 |
22 file {'/home/rsync/update_repos.sh': | 26 file {'/home/rsync/update_repos.sh': |
23 ensure => file, | 27 ensure => file, |
24 owner => rsync, | 28 owner => rsync, |
25 mode => 0700, | 29 mode => 0700, |
26 source => 'puppet:///modules/filtermaster/update_repos.sh' | 30 source => 'puppet:///modules/filtermaster/update_repos.sh' |
27 } | 31 } |
28 | 32 |
29 file {'/home/rsync/subscription': | 33 file {'/home/rsync/subscription': |
30 ensure => directory, | 34 ensure => directory, |
31 owner => rsync | 35 owner => rsync |
32 } | 36 } |
33 | 37 |
34 file {'/home/rsync/generated': | 38 file {'/home/rsync/generated': |
35 ensure => directory, | 39 ensure => directory, |
36 owner => rsync | 40 owner => rsync |
37 } | 41 } |
38 | 42 |
39 file {'/home/rsync/.ssh': | 43 file {'/home/rsync/.ssh': |
40 ensure => directory, | 44 ensure => directory, |
41 owner => rsync, | 45 owner => rsync, |
42 mode => 0600 | 46 mode => 0600 |
43 } | 47 } |
44 | 48 |
45 file {'/home/rsync/.ssh/authorized_keys': | 49 file {'/home/rsync/.ssh/authorized_keys': |
46 ensure => file, | 50 ensure => file, |
47 owner => rsync, | 51 owner => rsync, |
48 mode => 0600, | 52 mode => 0600, |
(...skipping 14 matching lines...) Expand all Loading... |
63 require => Package['openssh-server'], | 67 require => Package['openssh-server'], |
64 notify => Service['ssh'], | 68 notify => Service['ssh'], |
65 ensure => file, | 69 ensure => file, |
66 owner => root, | 70 owner => root, |
67 group => root, | 71 group => root, |
68 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub' | 72 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub' |
69 } | 73 } |
70 | 74 |
71 package {['p7zip-full']:} | 75 package {['p7zip-full']:} |
72 | 76 |
73 define repo_download() { | 77 define repo_download() { |
74 exec {"fetch_${title}": | 78 exec {"fetch_${title}": |
75 command => "hg clone https://hg.adblockplus.org/${title} /home/rsync/subsc
ription/${title}", | 79 command => "hg clone https://hg.adblockplus.org/${title} /home/rsync/subsc
ription/${title}", |
76 path => ["/usr/bin/", "/bin/"], | 80 path => ["/usr/bin/", "/bin/"], |
77 require => Package['mercurial'], | 81 require => Package['mercurial'], |
78 user => rsync, | 82 user => rsync, |
79 timeout => 0, | 83 timeout => 0, |
80 onlyif => "test ! -d /home/rsync/subscription/${title}" | 84 onlyif => "test ! -d /home/rsync/subscription/${title}" |
81 } | 85 } |
82 } | 86 } |
83 | 87 |
84 repo_download {['easylist', | 88 repo_download {['easylist', |
85 'easylistgermany', | 89 'easylistgermany', |
86 'easylistitaly', | 90 'easylistitaly', |
87 'easylistcombinations', | 91 'easylistcombinations', |
88 'malwaredomains', | 92 'malwaredomains', |
89 'ruadlist', | 93 'ruadlist', |
90 'listefr', | 94 'listefr', |
91 'exceptionrules', | 95 'exceptionrules', |
92 'easylistdutch', | 96 'easylistdutch', |
93 'facebookfilters', | 97 'facebookfilters', |
94 'antiadblockfilters' | 98 'antiadblockfilters' |
95 ]: | 99 ]: |
96 } | 100 } |
97 | 101 |
98 cron {'update_subscription': | 102 cron {'update_subscription': |
99 ensure => present, | 103 ensure => present, |
100 command => "python -m sitescripts.subscriptions.bin.updateSubscriptionDownlo
ads 3>&1 1>/dev/null 2>&3 | perl -pe 's/^/\"[\" . scalar localtime() . \"] \"/e'
>> /tmp/subscription_errors && chmod 666 /tmp/subscription_errors 2>/dev/null", | 104 command => "python -m sitescripts.subscriptions.bin.updateSubscriptionDownlo
ads 3>&1 1>/dev/null 2>&3 | perl -pe 's/^/\"[\" . scalar localtime() . \"] \"/e'
>> /tmp/subscription_errors && chmod 666 /tmp/subscription_errors 2>/dev/null", |
101 user => rsync, | 105 user => rsync, |
102 require => User['rsync'], | 106 require => User['rsync'], |
103 minute => '*/10' | 107 minute => '*/10' |
104 } | 108 } |
105 | 109 |
106 cron {'update_malware': | 110 cron {'update_malware': |
107 ensure => present, | 111 ensure => present, |
108 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList
", | 112 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList
", |
109 user => rsync, | 113 user => rsync, |
110 require => User['rsync'], | 114 require => User['rsync'], |
111 hour => '*/6', | 115 hour => '*/6', |
112 minute => 15 | 116 minute => 15 |
113 } | 117 } |
114 | 118 |
115 cron {'update_repos': | 119 cron {'update_repos': |
116 ensure => present, | 120 ensure => present, |
117 command => "/home/rsync/update_repos.sh", | 121 command => "/home/rsync/update_repos.sh", |
118 user => rsync, | 122 user => rsync, |
119 require => [ | 123 require => [ |
120 User['rsync'], | 124 User['rsync'], |
121 File['/home/rsync/update_repos.sh'] | 125 File['/home/rsync/update_repos.sh'] |
122 ], | 126 ], |
123 minute => '8-58/10' | 127 minute => '8-58/10' |
124 } | 128 } |
125 | 129 |
126 class {'sitescripts': | 130 class {'sitescripts': |
127 sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts' | 131 sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts' |
128 } | 132 } |
129 } | 133 } |
OLD | NEW |