| Left: | ||
| Right: |
| 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/.ssh': | |
|
Felix Dahlke
2013/11/14 15:07:31
Can you move this down so it's right before author
christian
2013/11/14 15:26:43
Done.
| |
| 31 ensure => directory, | |
| 32 owner => rsync, | |
| 33 mode => 0600 | |
| 34 } | |
| 35 | |
| 36 file {'/home/rsync/subscription': | |
| 37 ensure => directory, | |
| 38 owner => rsync | |
| 39 } | |
| 40 | |
| 41 file {'/home/rsync/generated': | |
| 42 ensure => directory, | |
| 43 owner => rsync | |
| 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': | |
|
Felix Dahlke
2013/11/14 15:07:31
This should require the ssh package to be installe
christian
2013/11/14 15:26:43
Done.
| |
| 54 notify => Service["ssh"], | |
|
Felix Dahlke
2013/11/14 15:07:31
Only once space before =>.
christian
2013/11/14 15:26:43
Done.
| |
| 55 ensure => file, | |
| 56 owner => root, | |
| 57 group => root, | |
| 58 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.key' | |
| 59 } | |
| 60 | |
| 61 file {'/etc/ssh/ssh_host_rsa_key.pub': | |
| 62 notify => Service["ssh"], | |
| 63 ensure => file, | |
| 64 owner => root, | |
| 65 group => root, | |
| 66 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub' | |
| 67 } | |
| 68 | |
| 69 package {['p7zip-full']:} | |
| 70 | |
| 71 define repo_download( ) { | |
|
Felix Dahlke
2013/11/14 15:07:31
No space between ( and ).
christian
2013/11/14 15:26:43
Done.
| |
| 72 exec { "fetch_${title}": | |
|
Felix Dahlke
2013/11/14 15:07:31
No space before ", and ' instead of ".
christian
2013/11/14 15:26:43
remove space, will broke if i replace the " becaus
Felix Dahlke
2013/11/14 15:33:30
Oops, right.
| |
| 73 command => "hg clone https://hg.adblockplus.org/${title} /home/rsync/subs cription/${title}", | |
| 74 path => ["/usr/bin/", "/bin/"], | |
| 75 require => Package['mercurial'], | |
| 76 user => rsync, | |
| 77 timeout => 0, | |
| 78 onlyif => "test ! -d /home/rsync/subscription/${title}" | |
| 79 } | |
| 80 } | |
| 81 | |
| 82 repo_download {['easylist', | |
| 83 'easylistgermany', | |
| 84 'easylistitaly', | |
| 85 'easylistcombinations', | |
| 86 'malwaredomains', | |
| 87 'ruadlist', | |
| 88 'listefr', | |
| 89 'exceptionrules', | |
| 90 'easylistdutch', | |
| 91 'facebookfilters', | |
| 92 'antiadblockfilters' | |
| 93 ]: | |
| 94 } | |
| 95 | |
| 96 cron {'update_subscription': | |
| 97 ensure => present, | |
| 98 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", | |
| 99 user => rsync, | |
| 100 require => [ | |
| 101 User['rsync'] | |
| 102 ], | |
| 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 => [ | |
| 111 User['rsync'] | |
|
Felix Dahlke
2013/11/14 15:07:31
Just |require => User['rsync']| please.
christian
2013/11/14 15:26:43
Done.
| |
| 112 ], | |
| 113 hour => '*/6', | |
| 114 minute => 15 | |
| 115 } | |
| 116 | |
| 117 cron {'update_repos': | |
| 118 ensure => present, | |
| 119 command => "/home/rsync/update_repos.sh", | |
| 120 user => rsync, | |
| 121 require => [ | |
| 122 User['rsync'], | |
|
Felix Dahlke
2013/11/14 15:07:31
Can you indent this and the File below one level?
christian
2013/11/14 15:26:43
Done.
| |
| 123 File['/home/rsync/update_repos.sh'] | |
| 124 ], | |
| 125 minute => '8-58/10' | |
| 126 } | |
| 127 | |
| 128 class {'sitescripts': | |
| 129 sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts' | |
| 130 } | |
| 131 } | |
| OLD | NEW |