aboutsummaryrefslogtreecommitdiffstats
path: root/modules/dashboard/manifests/init.pp
blob: 6de553415d796e36b535115223c94eb1e6b62c0f (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
class dashboard {
    class variable {
        $dashboard_login = "dashboard"
        $dashboard_home_dir = "/var/lib/$dashboard_login"
        $dashboard_dir = "$dashboard_home_dir/dashboard"
        $dashboard_bindir = "$dashboard_home_dir/bin"
	$dashboard_wwwdir = "/var/www/vhosts/dashboard.$domain"
    }

    class base inherits variable {
        user {"$dashboard_login":
            ensure => present,
            comment => "dashboard system user",
            managehome => true,
            home => $dashboard_home_dir,
            shell => "/bin/bash",
        }

	subversion::snapshot { $dashboard_dir:
	    source => "svn://svn.$domain/soft/dashboard/",
	}

	package { "php-cli":
	    ensure => 'installed',
	}

	file { $dashboard_wwwdir:
	    ensure => directory,
	    owner => $dashboard_login,
	    group => $dashboard_login,
	    mode => 755,
	}

	file { $dashboard_bindir:
	    ensure => directory,
	    owner => root,
	    group => root,
	    mode => 755,
	}

	file { "$dashboard_bindir/make_report":
	    ensure => present,
	    owner => root,
	    group => root,
	    mode => 755,
	    content => template('dashboard/make_report'),
	}

	apache::vhost_base { "dashboard.$domain":
	    location => $dashboard_wwwdir,
	}

	cron { "update dashboard":
	    command => "$dashboard_bindir/make_report",
	    user => $dashboard_login,
	    hour => "*/2",
	    minute => '15',
	}
    }
}