summaryrefslogtreecommitdiff
path: root/puppet/modules/apache/manifests/defaultphpdirs.pp
blob: 595744bb60a757f8b0ab2da9347a33aa5bd155d7 (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
# setup some directories for php
class apache::defaultphpdirs {
    file{
      '/var/www/upload_tmp_dir':
        ensure  => directory,
        require => Package['apache'],
        owner   => root,
        group   => 0,
        mode    => '0755';
      '/var/www/session.save_path':
        ensure  => directory,
        require => Package['apache'],
        owner   => root,
        group   => 0,
        mode    => '0755';
    }

    if str2bool($::selinux) {
      $seltype_rw = $::operatingsystemmajrelease ? {
        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'];
      }
    }
}