| 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 owner => rsync, | 25 owner => rsync, |
| 26 mode => 0700, | 26 mode => 0700, |
| 27 source => 'puppet:///modules/filtermaster/update_repos.sh' | 27 source => 'puppet:///modules/filtermaster/update_repos.sh' |
| 28 } | 28 } |
| 29 | 29 |
| 30 file {'/home/rsync/.ssh': | |
| 31 ensure => directory, | |
| 32 owner => rsync, | |
| 33 mode => 0600 | |
| 34 } | |
| 35 | |
| 36 file {'/home/rsync/subscription': | 30 file {'/home/rsync/subscription': |
| 37 ensure => directory, | 31 ensure => directory, |
| 38 owner => rsync | 32 owner => rsync |
| 39 } | 33 } |
| 40 | 34 |
| 41 file {'/home/rsync/generated': | 35 file {'/home/rsync/generated': |
| 42 ensure => directory, | 36 ensure => directory, |
| 43 owner => rsync | 37 owner => rsync |
| 44 } | 38 } |
| 45 | 39 |
| 40 file {'/home/rsync/.ssh': | |
| 41 ensure => directory, | |
| 42 owner => rsync, | |
| 43 mode => 0600 | |
| 44 } | |
| 45 | |
| 46 file {'/home/rsync/.ssh/authorized_keys': | 46 file {'/home/rsync/.ssh/authorized_keys': |
| 47 ensure => file, | 47 ensure => file, |
| 48 require => File['/home/rsync/.ssh'], | |
|
Wladimir Palant
2013/11/13 14:03:51
As I said, *both* requires are unnecessary - the p
christian
2013/11/13 14:15:27
Done.
| |
| 49 owner => rsync, | 48 owner => rsync, |
| 50 mode => 0600, | 49 mode => 0600, |
| 51 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' | |
| 52 } | 69 } |
| 53 | 70 |
| 54 package {['p7zip-full']:} | 71 package {['p7zip-full']:} |
| 55 | 72 |
| 56 define repo_download( ) { | 73 define repo_download() { |
| 57 exec { "fetch_${title}": | 74 exec {"fetch_${title}": |
| 58 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}", |
| 59 path => ["/usr/bin/", "/bin/"], | 76 path => ["/usr/bin/", "/bin/"], |
| 60 require => Package['mercurial'], | 77 require => Package['mercurial'], |
| 61 user => rsync, | 78 user => rsync, |
| 62 timeout => 0, | 79 timeout => 0, |
| 63 onlyif => "test ! -d /home/rsync/subscription/${title}" | 80 onlyif => "test ! -d /home/rsync/subscription/${title}" |
| 64 } | 81 } |
| 65 } | 82 } |
| 66 | 83 |
| 67 repo_download {['easylist', | 84 repo_download {['easylist', |
| 68 'easylistgermany', | 85 'easylistgermany', |
| 69 'easylistitaly', | 86 'easylistitaly', |
| 70 'easylistcombinations', | 87 'easylistcombinations', |
| 71 'malwaredomains', | 88 'malwaredomains', |
| 72 'ruadlist', | 89 'ruadlist', |
| 73 'listefr', | 90 'listefr', |
| 74 'exceptionrules', | 91 'exceptionrules', |
| 75 'easylistdutch', | 92 'easylistdutch', |
| 76 'facebookfilters', | 93 'facebookfilters', |
| 77 'antiadblockfilters' | 94 'antiadblockfilters' |
| 78 ]: | 95 ]: |
| 79 } | 96 } |
| 80 | 97 |
| 81 cron {'update_subscription': | 98 cron {'update_subscription': |
| 82 ensure => present, | 99 ensure => present, |
| 83 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", |
| 84 user => rsync, | 101 user => rsync, |
| 85 require => [ | 102 require => User['rsync'], |
| 86 User['rsync'] | |
| 87 ], | |
| 88 minute => '*/10' | 103 minute => '*/10' |
| 89 } | 104 } |
| 90 | 105 |
| 91 cron {'update_malware': | 106 cron {'update_malware': |
| 92 ensure => present, | 107 ensure => present, |
| 93 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList ", | 108 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList ", |
| 94 user => rsync, | 109 user => rsync, |
| 95 require => [ | 110 require => User['rsync'], |
| 96 User['rsync'] | |
| 97 ], | |
| 98 hour => '*/6', | 111 hour => '*/6', |
| 99 minute => 15 | 112 minute => 15 |
| 100 } | 113 } |
| 101 | 114 |
| 102 cron {'update_repos': | 115 cron {'update_repos': |
| 103 ensure => present, | 116 ensure => present, |
| 104 command => "/home/rsync/update_repos.sh", | 117 command => "/home/rsync/update_repos.sh", |
| 105 user => rsync, | 118 user => rsync, |
| 106 require => [ | 119 require => [ |
| 107 User['rsync'], | 120 User['rsync'], |
| 108 File['/home/rsync/update_repos.sh'] | 121 File['/home/rsync/update_repos.sh'] |
| 109 ], | 122 ], |
| 110 minute => '8-58/10' | 123 minute => '8-58/10' |
| 111 } | 124 } |
| 112 | 125 |
| 113 class {'sitescripts': | 126 class {'sitescripts': |
| 114 sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts' | 127 sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts' |
| 115 } | 128 } |
| 116 } | 129 } |
| LEFT | RIGHT |