aboutsummaryrefslogtreecommitdiffstats
path: root/modules/youri-check
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2011-04-02 12:22:27 +0000
committerPascal Terjan <pterjan@mageia.org>2011-04-02 12:22:27 +0000
commit1a888419b6796e215c8a11fa9de10229b5cff1c0 (patch)
treedccb7448e02f207b21d83474f28d682326a0ebc3 /modules/youri-check
parentda14180248ec2ce2f17f1f69e176e30f6651eaed (diff)
downloadpuppet-1a888419b6796e215c8a11fa9de10229b5cff1c0.tar
puppet-1a888419b6796e215c8a11fa9de10229b5cff1c0.tar.gz
puppet-1a888419b6796e215c8a11fa9de10229b5cff1c0.tar.bz2
puppet-1a888419b6796e215c8a11fa9de10229b5cff1c0.tar.xz
puppet-1a888419b6796e215c8a11fa9de10229b5cff1c0.zip
Store youri-check results in pgsql, and generate the reports from there on alamut
Diffstat (limited to 'modules/youri-check')
-rw-r--r--modules/youri-check/manifests/init.pp86
-rw-r--r--modules/youri-check/templates/check.conf8
2 files changed, 57 insertions, 37 deletions
diff --git a/modules/youri-check/manifests/init.pp b/modules/youri-check/manifests/init.pp
index 02c7b91a..b1b2ea1f 100644
--- a/modules/youri-check/manifests/init.pp
+++ b/modules/youri-check/manifests/init.pp
@@ -1,49 +1,67 @@
class youri-check {
- class variable {
- $location = "/var/www/youri-check"
+ class base {
$vhost = "check.$domain"
- }
+ $user = 'youri'
+ $config = '/etc/youri/cauldron.conf'
+ $outdir = '/var/www/youri-check'
+ $home = '/var/tmp/youri'
- class check inherits variable {
- $user = 'youri'
- $home = '/var/tmp/youri'
- $outdir = "$home/www"
- $config = "/etc/youri/cauldron.conf"
+ user { $user:
+ comment => 'Youri Check',
+ ensure => present,
+ managehome => true,
+ home => $home,
+ }
- user { $user:
- comment => "Youri Check",
- ensure => present,
- managehome => true,
- home => $home,
+ $pgsql_server = "$vhost"
+ $pgsql_db = 'youri_check'
+ $pgsql_user = 'youri'
+ $pgsql_password = extlookup('youri_pgsql','x')
+ postgresql::remote_user { $pgsql_user:
+ password => $pgsql_password,
}
- package { ['perl-Youri-Media', 'youri-check', 'perl-DBD-SQLite'] :
+ }
+
+ class check inherits base {
+ package { ['perl-Youri-Media', 'youri-check', 'perl-DBD-Pg'] :
ensure => installed
- }
-
- cron { 'check':
- command => "youri-check -c $config test && youri-check -c $config report",
- hour => 6,
- user => "$user",
- }
-
- file { "$config":
- ensure => present,
- owner => $user,
- mode => 640,
- content => template("youri-check/check.conf"),
- }
+ }
+
+ cron { 'check':
+ command => "youri-check -c $config test",
+ hour => [0, 6, 12, 18]
+ minute => 4
+ user => "$user",
+ }
+
+ file { "$config":
+ ensure => present,
+ owner => $user,
+ mode => 640,
+ content => template("youri-check/check.conf"),
+ }
}
- class website inherits variable {
- file { "$location":
- ensure => directory,
+ class report inherits base {
+ file { "$outdir":
+ ensure => directory,
owner => apache,
- mode => 755
- }
+ mode => 755
+ }
+
+ package { ['youri-check', 'perl-DBD-Pg'] :
+ ensure => installed
+ }
+
+ cron { 'check':
+ command => "youri-check -c $config report",
+ hour => [1, 7, 13, 19]
+ user => "$user",
+ }
apache::vhost_simple { $vhost:
- location => $location,
+ location => $outdir,
}
}
}
diff --git a/modules/youri-check/templates/check.conf b/modules/youri-check/templates/check.conf
index be89b065..a57460df 100644
--- a/modules/youri-check/templates/check.conf
+++ b/modules/youri-check/templates/check.conf
@@ -9,9 +9,11 @@ mirror_x86_64: ${mirror}/x86_64/media
resultset:
class: Youri::Check::Resultset::DBI
options:
- driver: SQLite
- host: localhost
- base: youri.db
+ driver: Pg
+ host: <%= pgsql_server %>
+ base: <%= pgsql_db %>
+ user: <%= pgsql_user %>
+ password: <%= pgsql_password %>
# checks definitions
tests: