Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 class filtermaster { | |
2 Cron { | |
3 #TODO: Change The MAILTO to the correct paramater befor commiting | |
4 environment => ['MAILTO=ROOT', 'PYTHONPATH=/opt/sitescripts'], | |
5 } | |
6 | |
7 class {'ssh': | |
8 custom_configuration => 'Match User rsync | |
9 AllowTcpForwarding no | |
10 X11Forwarding no | |
11 AllowAgentForwarding no | |
12 GatewayPorts no | |
13 ForceCommand rsync --server --sender -vltprz --delete-excluded . /home/rsync /subscription/files/subscriptions/data' | |
Wladimir Palant
2013/11/12 13:04:03
I think the slash at the end of the path isn't opt
| |
14 } | |
15 | |
16 user {'rsync': | |
17 ensure => present, | |
18 comment => 'Filter list mirror user', | |
19 home => '/home/rsync', | |
20 managehome => true | |
21 } | |
22 | |
23 file {'/home/rsync/update_repos.sh': | |
24 ensure => file, | |
25 require => User['rsync'], | |
26 owner => rsync, | |
27 mode => 0700, | |
28 source => 'puppet:///modules/filtermaster/update_repos.sh' | |
29 } | |
30 | |
31 file {'/home/rsync/.ssh': | |
32 ensure => directory, | |
33 require => User['rsync'], | |
34 owner => rsync, | |
35 mode => 0600 | |
36 } | |
37 | |
38 file {'/home/rsync/subscription': | |
39 ensure => directory, | |
40 require => User['rsync'], | |
41 owner => rsync | |
42 } | |
43 | |
44 file {'/home/rsync/subscription/files': | |
45 ensure => directory, | |
46 require => [ | |
47 File['/home/rsync/subscription'], | |
48 User['rsync'] | |
49 ], | |
50 owner => rsync | |
51 } | |
52 | |
53 file {'/home/rsync/subscription/files/subscriptions': | |
54 ensure => directory, | |
55 require => [ | |
56 File['/home/rsync/subscription/files'], | |
57 User['rsync'] | |
58 ], | |
59 owner => rsync | |
60 } | |
61 | |
62 file {'/home/rsync/.ssh/authorized_keys': | |
63 ensure => file, | |
64 require => [ | |
65 File['/home/rsync/.ssh'], | |
66 User['rsync'] | |
67 ], | |
68 owner => rsync, | |
69 mode => 0600, | |
70 source => 'puppet:///modules/filtermaster/authorized_keys' | |
71 } | |
72 | |
73 package {['p7zip-full']:} | |
74 | |
75 define repo_download( ) { | |
76 exec { "fetch_${title}": | |
77 command => "hg clone https://hg.adblockplus.org/${title} /home/rsync/subs cription/${title}", | |
78 path => ["/usr/bin/", "/bin/"], | |
79 require => Package['mercurial'], | |
80 user => rsync, | |
81 timeout => 0, | |
82 onlyif => "test ! -d /home/rsync/subscription/${title}" | |
83 } | |
84 } | |
85 | |
86 repo_download {['easylist', | |
87 'easylistgermany', | |
88 'easylistitaly', | |
89 'easylistcombinations', | |
90 'malwaredomains', | |
91 'ruadlist', | |
92 'listefr', | |
93 'exceptionrules', | |
94 'easylistdutch', | |
95 'facebookfilters', | |
96 'antiadblockfilters' | |
97 ]: | |
98 } | |
99 | |
100 cron {'update_subscription': | |
101 ensure => present, | |
102 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", | |
103 user => rsync, | |
104 require => [ | |
105 User['rsync'] | |
106 ], | |
107 minute => '*/10' | |
108 } | |
109 | |
110 cron {'update_malware': | |
111 ensure => present, | |
112 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList ", | |
113 user => rsync, | |
114 require => [ | |
115 User['rsync'] | |
116 ], | |
117 hour => '*/6', | |
118 minute => 15 | |
119 } | |
120 | |
121 cron {'update_repos': | |
122 ensure => present, | |
123 command => "/home/rsync/update_repos.sh 1>/dev/null", | |
124 user => rsync, | |
125 require => [ | |
126 User['rsync'], | |
127 File['/home/rsync/update_repos.sh'] | |
128 ], | |
129 minute => '*/5' | |
Wladimir Palant
2013/11/12 13:04:03
It doesn't make sense to update repositories at th
| |
130 } | |
131 | |
132 class {'sitescripts': | |
133 sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts' | |
134 } | |
135 } | |
OLD | NEW |