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