diff options
Diffstat (limited to 'manifests/defaultphpdirs.pp')
-rw-r--r-- | manifests/defaultphpdirs.pp | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/manifests/defaultphpdirs.pp b/manifests/defaultphpdirs.pp index fdbe8a5..5485241 100644 --- a/manifests/defaultphpdirs.pp +++ b/manifests/defaultphpdirs.pp @@ -1,14 +1,31 @@ -# manifests/defaultphpdirs.pp - +# setup some directories for php class apache::defaultphpdirs { - file{'/var/www/upload_tmp_dir': - ensure => directory, + file{ + '/var/www/upload_tmp_dir': + ensure => directory, require => Package['apache'], - owner => root, group => 0, mode => 0755; - } - file{'/var/www/session.save_path': - ensure => directory, + owner => root, + group => 0, + mode => '0755'; + '/var/www/session.save_path': + ensure => directory, require => Package['apache'], - owner => root, group => 0, mode => 0755; + owner => root, + group => 0, + mode => '0755'; + } + + if $::selinux != 'false' { + $seltype_rw = $::lsbmajdistrelease ? { + 5 => 'httpd_sys_script_rw_t', + default => 'httpd_sys_rw_content_t' + } + selinux::fcontext{ + [ '/var/www/upload_tmp_dir/.+(/.*)?', + '/var/www/session.save_path/.+(/.*)?' ]: + require => Package['apache'], + setype => $seltype_rw, + before => File['/var/www/upload_tmp_dir','/var/www/session.save_path']; + } } } |