diff options
Diffstat (limited to 'manifests/vhost/phpdirs.pp')
-rw-r--r-- | manifests/vhost/phpdirs.pp | 76 |
1 files changed, 33 insertions, 43 deletions
diff --git a/manifests/vhost/phpdirs.pp b/manifests/vhost/phpdirs.pp index 24413d0..5936da6 100644 --- a/manifests/vhost/phpdirs.pp +++ b/manifests/vhost/phpdirs.pp @@ -1,49 +1,39 @@ define apache::vhost::phpdirs( - $ensure = present, - $php_upload_tmp_dir = 'absent', - $php_session_save_path = 'absent', - $documentroot_owner = apache, - $documentroot_group = 0, - $documentroot_mode = 0750, - $run_mode = 'normal', - $run_uid = 'absent' + $ensure = present, + $php_upload_tmp_dir, + $php_session_save_path, + $documentroot_owner = apache, + $documentroot_group = 0, + $documentroot_mode = 0750, + $run_mode = 'normal', + $run_uid = 'absent' ){ - # php upload_tmp_dir - case $php_upload_tmp_dir { - 'absent': { - include apache::defaultphpdirs - $real_php_upload_tmp_dir = "/var/www/upload_tmp_dir/$name" - } - default: { $real_php_upload_tmp_dir = $php_upload_tmp_dir } + case $ensure { + absent : { + file { + [$php_upload_tmp_dir, $php_session_save_path] : + ensure => absent, + purge => true, + force => true, + recurse => true, + } } - # php session_save_path - case $php_session_save_path { - 'absent': { - include apache::defaultphpdirs - $real_php_session_save_path = "/var/www/session.save_path/$name" - } - default: { $real_php_session_save_path = $php_session_save_path } - } - - case $ensure { - absent: { - file{[$real_php_upload_tmp_dir, $real_php_session_save_path ]: - ensure => absent, - purge => true, - force => true, - recurse => true, - } - } - default: { - file{[$real_php_upload_tmp_dir, $real_php_session_save_path ]: - ensure => directory, - owner => $run_mode ? { - 'itk' => $run_uid, - default => $documentroot_owner - }, - group => $documentroot_group, mode => $documentroot_mode; - } - } + default : { + include apache::defaultphpdirs + file { + [$php_upload_tmp_dir, $php_session_save_path] : + ensure => directory, + owner => $run_mode ? { + 'itk' => $run_uid, + 'static-itk' => $run_uid, + 'proxy-itk' => $run_uid, + 'fcgid' => $run_uid, + default => $documentroot_owner + }, + group => $documentroot_group, + mode => $documentroot_mode ; + } } + } } |