Puppet Class: confdroid_apache::server::files

Inherits:
confdroid_apache::params
Defined in:
manifests/server/files.pp

Summary

Manage all aspects for the httpd configuration, if enabled.

Overview

confdroid_apache::server::files.pp Module name: confdroid_apache Author: 12ww1160 (12ww1160@confdroid.com)



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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'manifests/server/files.pp', line 6

class confdroid_apache::server::files (

) inherits confdroid_apache::params {
  require confdroid_apache::server::dirs

  if $ae_manage_cfg == true {
    # manage main config file

    file { $ae_conf_file:
      ensure   => file,
      path     => $ae_conf_file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => httpd_config_t,
      seluser  => system_u,
      content  => template($ae_conf_file_erb),
      notify   => Service['httpd'],
    }

    # manage magic file

    file { $ae_magic_file:
      ensure   => file,
      path     => $ae_magic_file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => httpd_config_t,
      seluser  => system_u,
      content  => template($ae_magic_file_erb),
      notify   => Service['httpd'],
    }

    # manage main ssl config file

    file { $ae_ssl_file:
      ensure   => file,
      path     => $ae_ssl_file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => httpd_config_t,
      seluser  => system_u,
      content  => template($ae_ssl_file_erb),
      notify   => Service['httpd'],
    }

    # manage autoindex.conf

    file { $ae_autoindex_file:
      ensure   => file,
      path     => $ae_autoindex_file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => httpd_config_t,
      seluser  => system_u,
      content  => template($ae_autoindex_erb),
      notify   => Service['httpd'],
    }

    if $ae_allow_user_dirs == true {
      # manage userdir.conf

      file { $ae_userdir_file:
        ensure   => file,
        path     => $ae_userdir_file,
        owner    => 'root',
        group    => 'root',
        mode     => '0644',
        selrange => s0,
        selrole  => object_r,
        seltype  => httpd_config_t,
        seluser  => system_u,
        content  => template($ae_userdir_erb),
        notify   => Service['httpd'],
      }
    }
  }

  if $ae_use_lb == true {
    file { $ae_remoteip_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => httpd_conf_t,
      seluser  => system_u,
      content  => template($ae_remoteip_erb),
      notify   => Service['httpd'],
    }
  }

  # manage index.html

  file { $ae_index_file:
    ensure   => file,
    path     => $ae_index_file,
    owner    => 'apache',
    group    => 'apache',
    mode     => '0644',
    selrange => s0,
    selrole  => object_r,
    seltype  => httpd_sys_content_t,
    seluser  => system_u,
    content  => template($ae_index_erb),
    notify   => Service['httpd'],
  }
}