| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| (Empty) | |
| 1 class filtermaster { | |
| 2 Cron { | |
| 3 environment => ['MAILTO=ROOT', 'PYTHONPATH=/opt/sitescripts'], | |
|
Wladimir Palant
2013/11/08 15:32:06
Add a TODO comment so that you don't forget to cha
christian
2013/11/08 16:25:01
Done.
| |
| 4 } | |
| 5 | |
| 6 class {'ssh': | |
| 7 custom_configuration => 'Match User rsync | |
| 8 AllowTcpForwarding no | |
| 9 X11Forwarding no | |
| 10 AllowAgentForwarding no | |
| 11 GatewayPorts no | |
| 12 ForceCommand rsync --server --sender -vltprz --delete-excluded --exclude CVS . /home/rsync/subscriptions/' | |
|
Wladimir Palant
2013/11/08 15:32:06
/home/rsync/subscriptions isn't what you want to s
christian
2013/11/08 16:25:01
Done.
| |
| 13 } | |
| 14 | |
| 15 user {'rsync': | |
| 16 ensure => present, | |
| 17 comment => 'Filter list mirror user', | |
| 18 home => '/home/rsync', | |
| 19 managehome => true | |
| 20 } | |
| 21 | |
| 22 file {'/home/rsync/.ssh': | |
| 23 ensure => directory, | |
| 24 require => User['rsync'], | |
| 25 owner => rsync, | |
| 26 mode => 0600 | |
| 27 } | |
| 28 | |
| 29 file {'/home/rsync/.ssh/authorized_keys': | |
| 30 ensure => file, | |
| 31 require => [ | |
| 32 File['/home/rsync/.ssh'], | |
| 33 User['rsync'] | |
| 34 ], | |
| 35 owner => rsync, | |
| 36 mode => 0600, | |
| 37 source => 'puppet:///modules/filtermaster/authorized_keys' | |
| 38 } | |
| 39 | |
| 40 file {'/etc/sitescripts': | |
| 41 ensure => file, | |
| 42 owner => root, | |
| 43 mode => 0644, | |
| 44 source => 'puppet:///modules/filtermaster/sitescripts' | |
| 45 } | |
| 46 | |
| 47 #donwload the repos | |
|
Wladimir Palant
2013/11/08 15:32:06
Typo: donwload => download
Felix Dahlke
2013/11/08 15:49:39
I'd actually remove this, "repo_download" pretty m
christian
2013/11/08 16:25:01
Done.
| |
| 48 | |
| 49 define repo_download( $name ) { | |
| 50 exec { "fetch_${title}": | |
| 51 command => "hg clone https://hg.adblockplus.org/${name} /home/rsync/subsc ription/${name}", | |
| 52 path => ["/usr/bin/", "/bin/"], | |
| 53 require => Package['mercurial'], | |
| 54 user => rsync, | |
| 55 timeout => 0, | |
| 56 onlyif => "test ! -d /home/rsync/subscription/${name}" | |
| 57 } | |
|
Wladimir Palant
2013/11/08 15:32:06
What about a cron job to update these repositories
christian
2013/11/08 16:25:01
Don't "updateSubscriptionDownloads" update all rep
| |
| 58 } | |
| 59 | |
| 60 repo_download {'easylist': | |
| 61 name => "easylist" | |
| 62 } | |
| 63 | |
| 64 repo_download {'easylist_germany': | |
| 65 name => "easylistgermany" | |
|
Wladimir Palant
2013/11/08 15:32:06
This looks redundant, why not drop the $name param
Felix Dahlke
2013/11/08 15:49:39
Yes, then you could actually do this:
repo_downlo
| |
| 66 } | |
| 67 | |
| 68 repo_download {'easylist_italy': | |
| 69 name => "easylistitaly" | |
| 70 } | |
| 71 | |
| 72 repo_download {'easylist_combinations': | |
| 73 name => "easylistcombinations" | |
| 74 } | |
| 75 | |
| 76 repo_download {'malwaredomains': | |
| 77 name => "malwaredomains" | |
| 78 } | |
| 79 | |
| 80 repo_download {'ruadlist': | |
| 81 name => "ruadlist" | |
| 82 } | |
| 83 | |
| 84 repo_download {'listefr': | |
| 85 name => "listefr" | |
| 86 } | |
| 87 | |
| 88 repo_download {'exceptionrules': | |
| 89 name => "exceptionrules" | |
| 90 } | |
| 91 | |
| 92 cron {update_subscription: | |
|
Felix Dahlke
2013/11/08 15:49:39
Still needs to go in '' for consistency, same belo
| |
| 93 ensure => present, | |
| 94 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", | |
| 95 user => rsync, | |
| 96 require => [ | |
| 97 User['rsync'] | |
| 98 ], | |
| 99 minute => '*/10' | |
| 100 } | |
| 101 | |
| 102 cron {update_malware: | |
| 103 ensure => present, | |
| 104 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList ", | |
| 105 user => rsync, | |
| 106 require => [ | |
| 107 User['rsync'] | |
| 108 ], | |
| 109 hour => '*/6', | |
| 110 minute => 15 | |
| 111 } | |
| 112 } | |
| OLD | NEW |