summaryrefslogtreecommitdiff
path: root/puppet/modules/apache/manifests/vhost/phpdirs.pp
blob: 5936da619c1c6badc2abf441fb5fa06e9bd8deaa (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
32
33
34
35
36
37
38
39
define apache::vhost::phpdirs(
  $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'
){
  case $ensure {
    absent : {
      file {
        [$php_upload_tmp_dir, $php_session_save_path] :
          ensure => absent,
          purge => true,
          force => true,
          recurse => true,
      }
    }
    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 ;
      }
    }
  }
}