aboutsummaryrefslogtreecommitdiffstats
path: root/modules/youri-check/manifests/init.pp
blob: 095aaae40e9091fa3c1bf3a973b763fb63ecf6aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class youri-check {
    $location = "/var/www/youri-check"
    $vhost = "check.$domain"

    class check {
	$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,
        }

	package { ['perl-Youri-Media', 'youri-check', 'perl-DBD-SQLite'] :
            ensure => installed
	}

	cron { 'check':
	    command => "youri-check -c $config test && youri-check -c $config report",
	    hour => 6,
	}

	file { "$config":
	    ensure => present,
	    owner => $user,
	    mode => 640,
	    content => template("youri-check/check.conf"),
	}
    }

    class website($vhost="$vhost", $location="$location") {
	file { "$location":
	    ensure => directory,
            owner => apache,
	    mode => 755
	}

        apache::vhost_simple { $vhost:
            location => $location,
        }
    }
}