OLD | NEW |
(Empty) | |
| 1 class filtermaster { |
| 2 Cron { |
| 3 environment => ['MAILTO=ROOT', 'PYTHONPATH=/opt/sitescripts'], |
| 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/' |
| 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 |
| 48 |
| 49 class repo_download( $name ) { |
| 50 exec { "fetch_repo": |
| 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 } |
| 58 } |
| 59 |
| 60 class {'repo_download': |
| 61 name => "easylist" |
| 62 } |
| 63 |
| 64 class {'repo_download': |
| 65 name => "easylistgermany" |
| 66 } |
| 67 |
| 68 # exec { "fetch_easylist": |
| 69 # command => "hg clone https://hg.adblockplus.org/easylist /home/rsync/subscr
iption/easylist", |
| 70 # path => ["/usr/bin/", "/bin/"], |
| 71 # require => Package['mercurial'], |
| 72 # user => rsync, |
| 73 # timeout => 0, |
| 74 # onlyif => "test ! -d /home/rsync/subscription/easylist" |
| 75 # } |
| 76 |
| 77 # exec { "fetch_easylist_germany": |
| 78 # command => "hg clone https://hg.adblockplus.org/easylistgermany /home/rsync
/subscription/easylistgermany", |
| 79 # path => ["/usr/bin/", "/bin/"], |
| 80 # require => Package['mercurial'], |
| 81 # user => rsync, |
| 82 # timeout => 0, |
| 83 # onlyif => "test ! -d /home/rsync/subscription/easylistgermany" |
| 84 # } |
| 85 |
| 86 exec { "fetch_easylist_italy": |
| 87 command => "hg clone https://hg.adblockplus.org/easylistitaly /home/rsync/su
bscription/easylistitaly", |
| 88 path => ["/usr/bin/", "/bin/"], |
| 89 require => Package['mercurial'], |
| 90 user => rsync, |
| 91 timeout => 0, |
| 92 onlyif => "test ! -d /home/rsync/subscription/easylistitaly" |
| 93 } |
| 94 |
| 95 exec { "fetch_easylist_combinations": |
| 96 command => "hg clone https://hg.adblockplus.org/easylistcombinations /home/r
sync/subscription/easylistcombinations", |
| 97 path => ["/usr/bin/", "/bin/"], |
| 98 require => Package['mercurial'], |
| 99 user => rsync, |
| 100 timeout => 0, |
| 101 onlyif => "test ! -d /home/rsync/subscription/easylistcombinations" |
| 102 } |
| 103 |
| 104 exec { "fetch_malwaredomains": |
| 105 command => "hg clone https://hg.adblockplus.org/malwaredomains /home/rsync/s
ubscription/malwaredomains", |
| 106 path => ["/usr/bin/", "/bin/"], |
| 107 require => Package['mercurial'], |
| 108 user => rsync, |
| 109 timeout => 0, |
| 110 onlyif => "test ! -d /home/rsync/subscription/malwaredomains" |
| 111 } |
| 112 |
| 113 exec { "fetch_ruadlist": |
| 114 command => "hg clone https://hg.adblockplus.org/ruadlist /home/rsync/subscri
ption/ruadlist", |
| 115 path => ["/usr/bin/", "/bin/"], |
| 116 require => Package['mercurial'], |
| 117 user => rsync, |
| 118 timeout => 0, |
| 119 onlyif => "test ! -d /home/rsync/subscription/ruadlist" |
| 120 } |
| 121 |
| 122 exec { "fetch_listefr": |
| 123 command => "hg clone https://hg.adblockplus.org/listefr /home/rsync/subscrip
tion/listefr", |
| 124 path => ["/usr/bin/", "/bin/"], |
| 125 require => Package['mercurial'], |
| 126 user => rsync, |
| 127 timeout => 0, |
| 128 onlyif => "test ! -d /home/rsync/subscription/listefr" |
| 129 } |
| 130 |
| 131 exec { "fetch_exceptionrules": |
| 132 command => "hg clone https://hg.adblockplus.org/exceptionrules /home/rsync/s
ubscription/exceptionrules", |
| 133 path => ["/usr/bin/", "/bin/"], |
| 134 require => Package['mercurial'], |
| 135 user => rsync, |
| 136 timeout => 0, |
| 137 onlyif => "test ! -d /home/rsync/subscription/exceptionrules" |
| 138 } |
| 139 |
| 140 cron {update_subscription: |
| 141 ensure => present, |
| 142 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", |
| 143 user => rsync, |
| 144 require => [ |
| 145 User['rsync'] |
| 146 ], |
| 147 minute => '*/10' |
| 148 } |
| 149 |
| 150 cron {update_malware: |
| 151 ensure => present, |
| 152 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList
", |
| 153 user => rsync, |
| 154 require => [ |
| 155 User['rsync'] |
| 156 ], |
| 157 hour => '*/6', |
| 158 minute => 15 |
| 159 } |
| 160 } |
OLD | NEW |