1 |
class youri-check { |
2 |
class variable { |
3 |
$location = "/var/www/youri-check" |
4 |
$vhost = "check.$domain" |
5 |
} |
6 |
|
7 |
class check inherits variable { |
8 |
$user = 'youri' |
9 |
$home = '/var/tmp/youri' |
10 |
$outdir = "$home/www" |
11 |
$config = "/etc/youri/cauldron.conf" |
12 |
|
13 |
user { $user: |
14 |
comment => "Youri Check", |
15 |
ensure => present, |
16 |
managehome => true, |
17 |
home => $home, |
18 |
} |
19 |
|
20 |
package { ['perl-Youri-Media', 'youri-check', 'perl-DBD-SQLite'] : |
21 |
ensure => installed |
22 |
} |
23 |
|
24 |
cron { 'check': |
25 |
command => "youri-check -c $config test && youri-check -c $config report", |
26 |
hour => 6, |
27 |
} |
28 |
|
29 |
file { "$config": |
30 |
ensure => present, |
31 |
owner => $user, |
32 |
mode => 640, |
33 |
content => template("youri-check/check.conf"), |
34 |
} |
35 |
} |
36 |
|
37 |
class website inherits variable { |
38 |
file { "$location": |
39 |
ensure => directory, |
40 |
owner => apache, |
41 |
mode => 755 |
42 |
} |
43 |
|
44 |
apache::vhost_simple { $vhost: |
45 |
location => $location, |
46 |
} |
47 |
} |
48 |
} |