diff options
author | Pascal Terjan <pterjan@mageia.org> | 2012-02-16 22:50:13 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2012-02-16 22:50:13 +0000 |
commit | 6a46dcaedd57ad670cff8c086a206bbbe13bfaae (patch) | |
tree | 89187f81292bfa3b4bfbdf6a9798d8bb888f5e33 | |
parent | 12551d6f309fe6355f6d8191d176ecb01fb0d49a (diff) | |
download | puppet-6a46dcaedd57ad670cff8c086a206bbbe13bfaae.tar puppet-6a46dcaedd57ad670cff8c086a206bbbe13bfaae.tar.gz puppet-6a46dcaedd57ad670cff8c086a206bbbe13bfaae.tar.bz2 puppet-6a46dcaedd57ad670cff8c086a206bbbe13bfaae.tar.xz puppet-6a46dcaedd57ad670cff8c086a206bbbe13bfaae.zip |
Run youri-check both on 1 and cauldron (this is ugly but currently work)
-rw-r--r-- | modules/youri-check/manifests/init.pp | 90 | ||||
-rw-r--r-- | modules/youri-check/templates/1.conf | 183 | ||||
-rw-r--r-- | modules/youri-check/templates/cauldron.conf (renamed from modules/youri-check/templates/check.conf) | 49 |
3 files changed, 237 insertions, 85 deletions
diff --git a/modules/youri-check/manifests/init.pp b/modules/youri-check/manifests/init.pp index 4d7abbca..16d9d4dc 100644 --- a/modules/youri-check/manifests/init.pp +++ b/modules/youri-check/manifests/init.pp @@ -2,8 +2,6 @@ class youri-check { class base { $vhost = "check.$domain" $user = 'youri' - $config = '/etc/youri/cauldron.conf' - $outdir = '/var/www/youri-check' $home = '/var/lib/youri' user { $user: @@ -17,57 +15,77 @@ class youri-check { group => $user, } - $pgsql_server = "$vhost" - $pgsql_db = 'youri_check' - $pgsql_user = 'youri' - $pgsql_password = extlookup('youri_pgsql','x') - - file { "$config": - ensure => present, - owner => $user, - mode => 640, - content => template("youri-check/check.conf"), - } + $pgsql_server = "$vhost" + + package { ['youri-check', 'perl-DBD-Pg', 'perl-Youri-Media']: } + } - class check inherits base { - package { ['perl-Youri-Media', 'youri-check', 'perl-DBD-Pg']: } + define config($version) { + $config = "/etc/youri/$version.conf" + $outdir = "/var/www/youri-check/$version" + $pgsql_db = "youri_check_$version" + $pgsql_server = $base::pgsql_server + $pgsql_user = "youri$version" + $pgsql_password = extlookup('youri_pgsql','x') - cron { 'check': - command => "youri-check -c $config test", - hour => "*", - minute => 4, - user => "$user", - environment => "MAILTO=root", - } + file { "$config": + ensure => present, + owner => $base::user, + mode => 640, + content => template("youri-check/$version.conf"), + } } - class report inherits base { - file { "$outdir": - ensure => directory, - owner => $user, - } + define check($version, $hour = "*", $minute = 0) { + include youri-check::base + $config = "/etc/youri/$version.conf" + $pgsql_server = $base::pgsql_server + $pgsql_db = "youri_check_$version" + $pgsql_user = "youri$version" + $pgsql_password = extlookup('youri_pgsql','x') postgresql::remote_user { $pgsql_user: - password => $pgsql_password, + password => $base::pgsql_password, } postgresql::remote_database { $pgsql_db: description => "Youri Check results", user => $pgsql_user, } + cron { "check_$version": + command => "youri-check -c $config test", + hour => $hour, + minute => $minute, + user => $base::user, + environment => "MAILTO=root", + } + } - package { ['youri-check', 'perl-DBD-Pg']: } + define report_www { + include youri-check::base + $outdir = "/var/www/youri-check/" + apache::vhost_simple { $base::vhost: + location => $outdir, + } + } - cron { 'check': - command => "youri-check -c $config report", - hour => "*", - minute => 24, - user => "$user", + define report($version, $hour = "*", $minute = 20) { + include youri-check::base + + $config = "/etc/youri/$version.conf" + + $outdir = "/var/www/youri-check/$version" + file { "$outdir": + ensure => directory, + owner => $base::user, } - apache::vhost_simple { $vhost: - location => $outdir, + cron { "check_$version": + command => "youri-check -c $config report", + hour => $hour, + minute => $minute, + user => $base::user, } } } diff --git a/modules/youri-check/templates/1.conf b/modules/youri-check/templates/1.conf new file mode 100644 index 00000000..ebbc145a --- /dev/null +++ b/modules/youri-check/templates/1.conf @@ -0,0 +1,183 @@ +# vim:ft=yaml:et:sw=4 + +# helper variables +mirror: /distrib/mageia/distrib/1 +mirror_i586: ${mirror}/i586/media +mirror_x86_64: ${mirror}/x86_64/media + +# resultset definition +resultset: + class: Youri::Check::Resultset::DBI + options: + driver: Pg + host: <%= pgsql_server %>;sslmode=require + base: <%= pgsql_db %> + user: <%= pgsql_user %> + pass: <%= pgsql_password %> + +resolver: + class: Youri::Check::Maintainer::Resolver::CGI + options: + url: http://pkgsubmit.<%= domain %>/data/maintdb.txt + exceptions: + - nobody + + +# checks definitions +tests: + dependencies: + class: Youri::Check::Test::Dependencies + + missing: + class: Youri::Check::Test::Missing + + updates_mandriva_2010_2: + class: Youri::Check::Test::Updates + options: + aliases: + # Only add exceptions here after making sure that the package has an Epoch + basesystem: ~ + bash-completion: ~ + sources: + mandriva: + class: Youri::Check::Test::Updates::Source::Media::Mandriva + options: + medias: + main.sources: + class: Youri::Media::URPM + options: + name: main + type: source + hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/main/release/media_info/hdlist.cz + mainupdates.sources: + class: Youri::Media::URPM + options: + name: main-updates + type: source + hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/main/updates/media_info/hdlist.cz + contrib.sources: + class: Youri::Media::URPM + options: + name: contrib + type: source + hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/contrib/release/media_info/hdlist.cz + contribupdates.sources: + class: Youri::Media::URPM + options: + name: contrib-updates + type: source + hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/contrib/updates/media_info/hdlist.cz + +# reports definitions +reports: + file: + class: Youri::Check::Report::File + options: + to: <%= outdir %> + global: 1 + individual: 1 + formats: + html: + class: Youri::Check::Report::Format::HTML + text: + class: Youri::Check::Report::Format::Text + rss: + class: Youri::Check::Report::Format::RSS + +# media definitions +medias: + core.i586: + class: Youri::Media::URPM + options: + name: core + type: binary + path: ${mirror_i586}/core + hdlist: ${mirror_i586}/media_info/hdlist_core.cz + options: + dependencies: + allowed: + - core.i586 + missing: + allowed: + - core.sources + + core.x86_64: + class: Youri::Media::URPM + options: + name: core + type: binary + path: ${mirror_x86_64}/core + hdlist: ${mirror_x86_64}/media_info/hdlist_core.cz + options: + dependencies: + allowed: + - core.x86_64 + - core.i586 + missing: + allowed: + - core.sources + + + core.sources: + class: Youri::Media::URPM + options: + name: core + type: source + path: ${mirror_i586}/core + hdlist: ${mirror_i586}/media_info/hdlist_core.src.cz + options: + dependencies: + allowed: + - core.x86_64 + - core.i586 + + nonfree.i586: + class: Youri::Media::URPM + options: + name: nonfree + type: binary + path: ${mirror_i586}/nonfree/release + hdlist: ${mirror_i586}/media_info/hdlist_nonfree_release.cz + options: + dependencies: + allowed: + - core.i586 + - nonfree.i586 + missing: + allowed: + - nonfree.sources + + nonfree.x86_64: + class: Youri::Media::URPM + options: + name: nonfree + type: binary + path: ${mirror_x86_64}/nonfree/release + hdlist: ${mirror_x86_64}/media_info/hdlist_nonfree_release.cz + options: + dependencies: + allowed: + - core.x86_64 + - core.i586 + - nonfree.x86_64 + - nonfree.i586 + missing: + allowed: + - nonfree.sources + + + nonfree.sources: + class: Youri::Media::URPM + options: + name: nonfree + type: source + path: ${mirror_i586}/nonfree/release + hdlist: ${mirror_i586}/media_info/hdlist_nonfree_release.src.cz + options: + dependencies: + allowed: + - core.x86_64 + - nonfree.x86_64 + - core.i586 + - nonfree.i586 + diff --git a/modules/youri-check/templates/check.conf b/modules/youri-check/templates/cauldron.conf index a68dba95..99d1714a 100644 --- a/modules/youri-check/templates/check.conf +++ b/modules/youri-check/templates/cauldron.conf @@ -267,55 +267,6 @@ tests: mandriva: class: Youri::Check::Test::Updates::Source::Media::Mandriva - updates_mandriva_2010_2: - class: Youri::Check::Test::Updates - options: - aliases: - # Only add exceptions here after making sure that the package has an Epoch - basesystem: ~ - bash-completion: ~ - sources: - mandriva: - class: Youri::Check::Test::Updates::Source::Media::Mandriva - options: - medias: - main.sources: - class: Youri::Media::URPM - options: - name: main - type: source - hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/main/release/media_info/hdlist.cz - mainupdates.sources: - class: Youri::Media::URPM - options: - name: main-updates - type: source - hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/main/updates/media_info/hdlist.cz - mainbackports.sources: - class: Youri::Media::URPM - options: - name: main-backports - type: source - hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/main/backports/media_info/hdlist.cz - contrib.sources: - class: Youri::Media::URPM - options: - name: contrib - type: source - hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/contrib/release/media_info/hdlist.cz - contribupdates.sources: - class: Youri::Media::URPM - options: - name: contrib-updates - type: source - hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/contrib/updates/media_info/hdlist.cz - contribbackports.sources: - class: Youri::Media::URPM - options: - name: contrib-backports - type: source - hdlist: http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2010.2/SRPMS/contrib/backports/media_info/hdlist.cz - # reports definitions reports: file: |