| OLD | NEW |
| 1 class filtermaster( | 1 class filtermaster( |
| 2 $repos = hiera('filtermaster::repos', []), | 2 $repos = hiera('filtermaster::repos', []), |
| 3 $repo_downloads = hiera('filtermaster::repo_downloads', {}), | 3 $repo_downloads = hiera('filtermaster::repo_downloads', {}), |
| 4 ) { | 4 ) { |
| 5 | 5 |
| 6 Cron { | 6 Cron { |
| 7 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/sitescript
s'], | 7 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/sitescript
s'], |
| 8 } | 8 } |
| 9 | 9 |
| 10 include ssh | 10 include ssh |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 require => Package['openssh-server'], | 82 require => Package['openssh-server'], |
| 83 notify => Service['ssh'], | 83 notify => Service['ssh'], |
| 84 ensure => file, | 84 ensure => file, |
| 85 owner => root, | 85 owner => root, |
| 86 group => root, | 86 group => root, |
| 87 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub' | 87 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub' |
| 88 } | 88 } |
| 89 | 89 |
| 90 package {['p7zip-full']:} | 90 package {['p7zip-full']:} |
| 91 | 91 |
| 92 define repo_download($alias = $title) { | |
| 93 | |
| 94 exec {"fetch_${title}": | |
| 95 command => "hg clone https://hg.adblockplus.org/${title} /home/rsync/subsc
ription/${title}", | |
| 96 path => ["/usr/bin/", "/bin/"], | |
| 97 require => Package['mercurial'], | |
| 98 user => rsync, | |
| 99 timeout => 0, | |
| 100 onlyif => "test ! -d /home/rsync/subscription/${title}" | |
| 101 } | |
| 102 } | |
| 103 | |
| 104 create_resources('filtermaster::repo_download', $repo_downloads) | 92 create_resources('filtermaster::repo_download', $repo_downloads) |
| 105 | 93 |
| 106 repo_download {$repos: | 94 filtermaster::repo_download {$repos: |
| 107 } | 95 } |
| 108 | 96 |
| 109 cron {'update_subscription': | 97 cron {'update_subscription': |
| 110 ensure => present, | 98 ensure => present, |
| 111 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 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", |
| 112 user => rsync, | 100 user => rsync, |
| 113 require => User['rsync'], | 101 require => User['rsync'], |
| 114 minute => '*/10' | 102 minute => '*/10' |
| 115 } | 103 } |
| 116 | 104 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 131 User['rsync'], | 119 User['rsync'], |
| 132 File['/home/rsync/update_repos.sh'] | 120 File['/home/rsync/update_repos.sh'] |
| 133 ], | 121 ], |
| 134 minute => '8-58/10' | 122 minute => '8-58/10' |
| 135 } | 123 } |
| 136 | 124 |
| 137 class {'sitescripts': | 125 class {'sitescripts': |
| 138 sitescriptsini_content => template('filtermaster/sitescripts.ini.erb'), | 126 sitescriptsini_content => template('filtermaster/sitescripts.ini.erb'), |
| 139 } | 127 } |
| 140 } | 128 } |
| OLD | NEW |