diff options
Diffstat (limited to 'modules/dashboard')
-rw-r--r-- | modules/dashboard/manifests/init.pp | 24 | ||||
-rw-r--r-- | modules/dashboard/templates/make_report | 8 |
2 files changed, 32 insertions, 0 deletions
diff --git a/modules/dashboard/manifests/init.pp b/modules/dashboard/manifests/init.pp index 5ff01a7d..5901f5ab 100644 --- a/modules/dashboard/manifests/init.pp +++ b/modules/dashboard/manifests/init.pp @@ -3,6 +3,8 @@ class dashboard { $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 { @@ -21,5 +23,27 @@ class dashboard { package { "php-cli": ensure => 'installed', } + + file { $dashboard_www: + 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'), + } } } diff --git a/modules/dashboard/templates/make_report b/modules/dashboard/templates/make_report new file mode 100644 index 00000000..25c2f316 --- /dev/null +++ b/modules/dashboard/templates/make_report @@ -0,0 +1,8 @@ +#!/bin/sh + +dashboard_dir='<%= dashboard_dir %>' +dashboard_wwwdir='<%= dashboard_wwwdir %>' + +cd "$dashboard_dir" +/usr/bin/php ./make_report.php > "$dashboard_wwwdir/index.html" + |