Commit 0cbb4c00 authored by mh's avatar mh
Browse files

add some more global options for user scripts

parent f3d800a8
......@@ -32,6 +32,7 @@ define webhosting::common(
$nagios_check_code = '200',
$nagios_use = 'generic-service',
$git_repo = 'absent',
$php_installation = false,
){
if ($run_gid == 'absent') {
if ($gid == 'uid') {
......@@ -192,13 +193,27 @@ define webhosting::common(
run_user => $real_run_uid_name,
}
if $ensure != 'absent' {
if $php_installation and $php_installation != 'system' {
$php_inst = regsubst($php_installation,'^scl','php')
require "::php::scl::${php_inst}"
$scl_name = getvar("php::scl::${php_inst}::scl_name")
} else {
$scl_name = false
}
if $scl_name and !('scl' in $user_scripts_options['global']) {
$real_user_scripts_options = deep_merge({
'global' => { 'scl' => $scl_name }
}, $user_scripts_options)
} else {
$real_user_scripts_options = $user_scripts_options
}
webhosting::user_scripts::manage{$name:
base_path => $vhost_path,
scripts => $user_scripts,
sftp_user => $real_uid_name,
run_user => $real_run_uid_name,
web_group => $real_gid_name,
options => $user_scripts_options,
options => $real_user_scripts_options,
}
}
if ($git_repo != 'absent') and ($ensure != 'absent') {
......
......@@ -107,6 +107,7 @@ define webhosting::php(
nagios_check_code => $nagios_check_code,
nagios_use => $nagios_use,
git_repo => $git_repo,
php_installation => $php_installation,
}
apache::vhost::php::standard{$name:
ensure => $ensure,
......
......@@ -106,6 +106,7 @@ define webhosting::php::drupal(
nagios_check_code => $nagios_check_code,
nagios_use => $nagios_use,
git_repo => $git_repo,
php_installation => $php_installation,
}
apache::vhost::php::drupal{$name:
......
......@@ -102,6 +102,7 @@ define webhosting::php::joomla(
nagios_check_code => $nagios_check_code,
nagios_use => $nagios_use,
git_repo => $git_repo,
php_installation => $php_installation,
}
$path = "/var/www/vhosts/${name}"
......
......@@ -106,6 +106,7 @@ define webhosting::php::mediawiki(
nagios_check_url => $nagios_check_url,
nagios_check_code => $nagios_check_code,
nagios_use => $nagios_use,
php_installation => $php_installation,
}
if $wwwmail and ($contact != 'unmanaged'){
......
......@@ -45,6 +45,7 @@ define webhosting::php::silverstripe(
$ssl_mode = false,
$php_settings = {},
$php_options = {},
$php_installation = 'system',
$vhost_mode = 'template',
$template_partial = 'absent',
$vhost_source = 'absent',
......@@ -104,6 +105,7 @@ define webhosting::php::silverstripe(
nagios_check_code => $nagios_check_code,
nagios_use => $nagios_use,
git_repo => $git_repo,
php_installation => $php_installation,
}
apache::vhost::php::silverstripe{$name:
......
......@@ -45,6 +45,7 @@ define webhosting::php::simplemachine(
$ssl_mode = false,
$php_settings = {},
$php_options = {},
$php_installation = 'system',
$vhost_mode = 'template',
$template_partial = 'absent',
$vhost_source = 'absent',
......@@ -101,6 +102,7 @@ define webhosting::php::simplemachine(
nagios_check_code => $nagios_check_code,
nagios_use => $nagios_use,
git_repo => $git_repo,
php_installation => $php_installation,
}
$path = "/var/www/vhosts/${name}"
......
......@@ -32,6 +32,7 @@ define webhosting::php::spip(
$run_uid_name = 'absent',
$run_gid = 'absent',
$run_gid_name = 'absent',
$php_installation = 'system',
$watch_adjust_webfiles = 'absent',
$user_scripts = 'absent',
$user_scripts_options = {},
......@@ -101,6 +102,7 @@ define webhosting::php::spip(
nagios_check_code => $nagios_check_code,
nagios_use => $nagios_use,
git_repo => $git_repo,
php_installation => $php_installation,
}
apache::vhost::php::spip{$name:
......
......@@ -105,6 +105,7 @@ define webhosting::php::typo3(
nagios_check_code => $nagios_check_code,
nagios_use => $nagios_use,
git_repo => $git_repo,
php_installation => $php_installation,
}
apache::vhost::php::typo3{$name:
......
......@@ -105,6 +105,7 @@ define webhosting::php::wordpress(
nagios_check_url => $nagios_check_url,
nagios_check_code => $nagios_check_code,
nagios_use => $nagios_use,
php_installation => $php_installation,
}
apache::vhost::php::wordpress{$name:
......
......@@ -20,6 +20,9 @@ define webhosting::user_scripts::manage(
'only_webreadable' => [],
'web_writable' => [],
},
'global' => {
'default_contact' => true,
},
}
$user_scripts_options = merge($default_options,$options)
......@@ -36,6 +39,14 @@ define webhosting::user_scripts::manage(
force => true;
}
if $user_scripts_options['global']['default_contact'] == true {
$hosting_contact = "security@${name}"
} elsif $user_scripts_options['global']['default_contact'] {
$hosting_contact = $user_scripts_options['global']['default_contact']
} else {
$hosting_contact = false
}
file{ "${scripts_path}/vhost.options":
content => template('webhosting/user_scripts/vhost.options.erb'),
owner => root,
......
......@@ -2,3 +2,9 @@ sftp_user: <%= @sftp_user %>
run_user: <%= @run_user %>
group: <%= @web_group %>
webdir: <%= @base_path %>/www
<% if @hosting_contact -%>
hosting_contact: <%= @hosting_contact %>
<% end -%>
<% if @user_scripts_options['global']['scl'] -%>
scl: <%= @user_scripts_options['global']['scl'] %>
<% end -%>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment