| 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 /subscription/files/subscriptions/data' | 13 ForceCommand rsync --server --sender -vltprz --delete-excluded . /home/rsync /generated/data/' |
|
Wladimir Palant
2013/11/12 13:04:03
I think the slash at the end of the path isn't opt
| |
| 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 |
| 30 file {'/home/rsync/subscription': | |
| 31 ensure => directory, | |
| 32 owner => rsync | |
| 33 } | |
| 34 | |
| 35 file {'/home/rsync/generated': | |
| 36 ensure => directory, | |
| 37 owner => rsync | |
| 38 } | |
| 39 | |
| 31 file {'/home/rsync/.ssh': | 40 file {'/home/rsync/.ssh': |
| 32 ensure => directory, | 41 ensure => directory, |
| 33 require => User['rsync'], | |
| 34 owner => rsync, | 42 owner => rsync, |
| 35 mode => 0600 | 43 mode => 0600 |
| 36 } | 44 } |
| 37 | 45 |
| 38 file {'/home/rsync/subscription': | 46 file {'/home/rsync/.ssh/authorized_keys': |
| 39 ensure => directory, | 47 ensure => file, |
| 40 require => User['rsync'], | 48 owner => rsync, |
| 41 owner => rsync | 49 mode => 0600, |
| 50 source => 'puppet:///modules/private/rsync@easylist-downloads.adblockplus.or g.pub' | |
| 42 } | 51 } |
| 43 | 52 |
| 44 file {'/home/rsync/subscription/files': | 53 file {'/etc/ssh/ssh_host_rsa_key': |
| 45 ensure => directory, | 54 require => Package['openssh-server'], |
| 46 require => [ | 55 notify => Service['ssh'], |
| 47 File['/home/rsync/subscription'], | 56 ensure => file, |
| 48 User['rsync'] | 57 owner => root, |
| 49 ], | 58 group => root, |
| 50 owner => rsync | 59 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.key' |
| 51 } | 60 } |
| 52 | 61 |
| 53 file {'/home/rsync/subscription/files/subscriptions': | 62 file {'/etc/ssh/ssh_host_rsa_key.pub': |
| 54 ensure => directory, | 63 require => Package['openssh-server'], |
| 55 require => [ | 64 notify => Service['ssh'], |
| 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, | 65 ensure => file, |
| 64 require => [ | 66 owner => root, |
| 65 File['/home/rsync/.ssh'], | 67 group => root, |
| 66 User['rsync'] | 68 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub' |
| 67 ], | |
| 68 owner => rsync, | |
| 69 mode => 0600, | |
| 70 source => 'puppet:///modules/filtermaster/authorized_keys' | |
| 71 } | 69 } |
| 72 | 70 |
| 73 package {['p7zip-full']:} | 71 package {['p7zip-full']:} |
| 74 | 72 |
| 75 define repo_download( ) { | 73 define repo_download() { |
| 76 exec { "fetch_${title}": | 74 exec {"fetch_${title}": |
| 77 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}", |
| 78 path => ["/usr/bin/", "/bin/"], | 76 path => ["/usr/bin/", "/bin/"], |
| 79 require => Package['mercurial'], | 77 require => Package['mercurial'], |
| 80 user => rsync, | 78 user => rsync, |
| 81 timeout => 0, | 79 timeout => 0, |
| 82 onlyif => "test ! -d /home/rsync/subscription/${title}" | 80 onlyif => "test ! -d /home/rsync/subscription/${title}" |
| 83 } | 81 } |
| 84 } | 82 } |
| 85 | 83 |
| 86 repo_download {['easylist', | 84 repo_download {['easylist', |
| 87 » » 'easylistgermany', | 85 'easylistgermany', |
| 88 » » 'easylistitaly', | 86 'easylistitaly', |
| 89 » » 'easylistcombinations', | 87 'easylistcombinations', |
| 90 » » 'malwaredomains', | 88 'malwaredomains', |
| 91 » » 'ruadlist', | 89 'ruadlist', |
| 92 » » 'listefr', | 90 'listefr', |
| 93 » » 'exceptionrules', | 91 'exceptionrules', |
| 94 » » 'easylistdutch', | 92 'easylistdutch', |
| 95 » » 'facebookfilters', | 93 'facebookfilters', |
| 96 » » 'antiadblockfilters' | 94 'antiadblockfilters' |
| 97 » » ]: | 95 ]: |
| 98 } | 96 } |
| 99 | 97 |
| 100 cron {'update_subscription': | 98 cron {'update_subscription': |
| 101 ensure => present, | 99 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", | 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", |
| 103 user => rsync, | 101 user => rsync, |
| 104 require => [ | 102 require => User['rsync'], |
| 105 User['rsync'] | |
| 106 ], | |
| 107 minute => '*/10' | 103 minute => '*/10' |
| 108 } | 104 } |
| 109 » » | 105 |
| 110 cron {'update_malware': | 106 cron {'update_malware': |
| 111 ensure => present, | 107 ensure => present, |
| 112 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList ", | 108 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList ", |
| 113 user => rsync, | 109 user => rsync, |
| 114 require => [ | 110 require => User['rsync'], |
| 115 User['rsync'] | |
| 116 ], | |
| 117 hour => '*/6', | 111 hour => '*/6', |
| 118 minute => 15 | 112 minute => 15 |
| 119 } | 113 } |
| 120 | 114 |
| 121 cron {'update_repos': | 115 cron {'update_repos': |
| 122 ensure => present, | 116 ensure => present, |
| 123 command => "/home/rsync/update_repos.sh 1>/dev/null", | 117 command => "/home/rsync/update_repos.sh", |
| 124 user => rsync, | 118 user => rsync, |
| 125 require => [ | 119 require => [ |
| 126 User['rsync'], | 120 User['rsync'], |
| 127 File['/home/rsync/update_repos.sh'] | 121 File['/home/rsync/update_repos.sh'] |
| 128 ], | 122 ], |
| 129 minute => '*/5' | 123 minute => '8-58/10' |
|
Wladimir Palant
2013/11/12 13:04:03
It doesn't make sense to update repositories at th
| |
| 130 } | 124 } |
| 131 | 125 |
| 132 class {'sitescripts': | 126 class {'sitescripts': |
| 133 sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts' | 127 sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts' |
| 134 } | 128 } |
| 135 }» | 129 } |
| LEFT | RIGHT |