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