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