OLD | NEW |
(Empty) | |
| 1 class filtermaster { |
| 2 Cron { |
| 3 #TODO change email |
| 4 environment => ['MAILTO=root', 'PYTHONPATH=/opt/sitescripts'], |
| 5 } |
| 6 |
| 7 class {'ssh': |
| 8 custom_configuration => 'Match User rsync |
| 9 AllowTcpForwarding no |
| 10 X11Forwarding no |
| 11 AllowAgentForwarding no |
| 12 GatewayPorts no |
| 13 ForceCommand rsync --server --sender -vltprz --delete-excluded . /home/rsync
/generated/data/' |
| 14 } |
| 15 |
| 16 user {'rsync': |
| 17 ensure => present, |
| 18 comment => 'Filter list mirror user', |
| 19 home => '/home/rsync', |
| 20 managehome => true |
| 21 } |
| 22 |
| 23 file {'/home/rsync/update_repos.sh': |
| 24 ensure => file, |
| 25 owner => rsync, |
| 26 mode => 0700, |
| 27 source => 'puppet:///modules/filtermaster/update_repos.sh' |
| 28 } |
| 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 |
| 40 file {'/home/rsync/.ssh': |
| 41 ensure => directory, |
| 42 owner => rsync, |
| 43 mode => 0600 |
| 44 } |
| 45 |
| 46 file {'/home/rsync/.ssh/authorized_keys': |
| 47 ensure => file, |
| 48 owner => rsync, |
| 49 mode => 0600, |
| 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' |
| 69 } |
| 70 |
| 71 package {['p7zip-full']:} |
| 72 |
| 73 define repo_download() { |
| 74 exec {"fetch_${title}": |
| 75 command => "hg clone https://hg.adblockplus.org/${title} /home/rsync/subsc
ription/${title}", |
| 76 path => ["/usr/bin/", "/bin/"], |
| 77 require => Package['mercurial'], |
| 78 user => rsync, |
| 79 timeout => 0, |
| 80 onlyif => "test ! -d /home/rsync/subscription/${title}" |
| 81 } |
| 82 } |
| 83 |
| 84 repo_download {['easylist', |
| 85 'easylistgermany', |
| 86 'easylistitaly', |
| 87 'easylistcombinations', |
| 88 'malwaredomains', |
| 89 'ruadlist', |
| 90 'listefr', |
| 91 'exceptionrules', |
| 92 'easylistdutch', |
| 93 'facebookfilters', |
| 94 'antiadblockfilters' |
| 95 ]: |
| 96 } |
| 97 |
| 98 cron {'update_subscription': |
| 99 ensure => present, |
| 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", |
| 101 user => rsync, |
| 102 require => User['rsync'], |
| 103 minute => '*/10' |
| 104 } |
| 105 |
| 106 cron {'update_malware': |
| 107 ensure => present, |
| 108 command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList
", |
| 109 user => rsync, |
| 110 require => User['rsync'], |
| 111 hour => '*/6', |
| 112 minute => 15 |
| 113 } |
| 114 |
| 115 cron {'update_repos': |
| 116 ensure => present, |
| 117 command => "/home/rsync/update_repos.sh", |
| 118 user => rsync, |
| 119 require => [ |
| 120 User['rsync'], |
| 121 File['/home/rsync/update_repos.sh'] |
| 122 ], |
| 123 minute => '8-58/10' |
| 124 } |
| 125 |
| 126 class {'sitescripts': |
| 127 sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts' |
| 128 } |
| 129 } |
OLD | NEW |