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 |
user => "$user", |
28 |
} |
29 |
|
30 |
file { "$config": |
31 |
ensure => present, |
32 |
owner => $user, |
33 |
mode => 640, |
34 |
content => template("youri-check/check.conf"), |
35 |
} |
36 |
} |
37 |
|
38 |
class website inherits variable { |
39 |
file { "$location": |
40 |
ensure => directory, |
41 |
owner => apache, |
42 |
mode => 755 |
43 |
} |
44 |
|
45 |
apache::vhost_simple { $vhost: |
46 |
location => $location, |
47 |
} |
48 |
} |
49 |
} |