1 |
pterjan |
1364 |
class youri-check { |
2 |
pterjan |
1447 |
class base { |
3 |
misc |
1371 |
$vhost = "check.$domain" |
4 |
pterjan |
1447 |
$user = 'youri' |
5 |
|
|
$config = '/etc/youri/cauldron.conf' |
6 |
|
|
$outdir = '/var/www/youri-check' |
7 |
|
|
$home = '/var/tmp/youri' |
8 |
pterjan |
1364 |
|
9 |
pterjan |
1447 |
user { $user: |
10 |
|
|
comment => 'Youri Check', |
11 |
|
|
ensure => present, |
12 |
|
|
managehome => true, |
13 |
|
|
home => $home, |
14 |
|
|
} |
15 |
pterjan |
1364 |
|
16 |
pterjan |
1447 |
$pgsql_server = "$vhost" |
17 |
|
|
$pgsql_db = 'youri_check' |
18 |
|
|
$pgsql_user = 'youri' |
19 |
|
|
$pgsql_password = extlookup('youri_pgsql','x') |
20 |
|
|
postgresql::remote_user { $pgsql_user: |
21 |
|
|
password => $pgsql_password, |
22 |
pterjan |
1368 |
} |
23 |
pterjan |
1455 |
postgresql::remote_database { $pgsql_db: |
24 |
|
|
description => "Youri Check results", |
25 |
|
|
user => $pgsql_user, |
26 |
|
|
} |
27 |
pterjan |
1364 |
|
28 |
pterjan |
1450 |
file { "$config": |
29 |
|
|
ensure => present, |
30 |
|
|
owner => $user, |
31 |
|
|
mode => 640, |
32 |
|
|
content => template("youri-check/check.conf"), |
33 |
|
|
} |
34 |
pterjan |
1447 |
} |
35 |
|
|
|
36 |
|
|
class check inherits base { |
37 |
|
|
package { ['perl-Youri-Media', 'youri-check', 'perl-DBD-Pg'] : |
38 |
pterjan |
1368 |
ensure => installed |
39 |
pterjan |
1447 |
} |
40 |
pterjan |
1364 |
|
41 |
pterjan |
1447 |
cron { 'check': |
42 |
|
|
command => "youri-check -c $config test", |
43 |
pterjan |
1448 |
minute => 4, |
44 |
pterjan |
1447 |
user => "$user", |
45 |
|
|
} |
46 |
pterjan |
1364 |
} |
47 |
|
|
|
48 |
pterjan |
1447 |
class report inherits base { |
49 |
|
|
file { "$outdir": |
50 |
|
|
ensure => directory, |
51 |
pterjan |
1482 |
owner => youri, |
52 |
pterjan |
1447 |
mode => 755 |
53 |
|
|
} |
54 |
pterjan |
1368 |
|
55 |
pterjan |
1447 |
package { ['youri-check', 'perl-DBD-Pg'] : |
56 |
|
|
ensure => installed |
57 |
|
|
} |
58 |
|
|
|
59 |
|
|
cron { 'check': |
60 |
|
|
command => "youri-check -c $config report", |
61 |
pterjan |
1485 |
minute => 10, |
62 |
pterjan |
1447 |
user => "$user", |
63 |
|
|
} |
64 |
|
|
|
65 |
pterjan |
1368 |
apache::vhost_simple { $vhost: |
66 |
pterjan |
1447 |
location => $outdir, |
67 |
pterjan |
1368 |
} |
68 |
pterjan |
1364 |
} |
69 |
|
|
} |