192 lines
4.7 KiB
Puppet
192 lines
4.7 KiB
Puppet
## cd_apache::server::dirs.pp
|
|
# Module name: cd_apache
|
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
|
# License:
|
|
# This file is part of cd_apache.
|
|
#
|
|
# cd_apache is used for providing automatic configuration of
|
|
# Apache Webserver.
|
|
# Copyright (C) 2014 confdroid (copyright@confdroid.com)
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
##############################################################################
|
|
|
|
|
|
class cd_apache::server::dirs (
|
|
|
|
) inherits cd_apache::params {
|
|
|
|
require cd_apache::server::user
|
|
|
|
if $ae_manage_dirs == true {
|
|
|
|
# create main dir
|
|
|
|
file { $ae_main_dir:
|
|
ensure => directory,
|
|
path => $ae_main_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_config_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# conf dir
|
|
|
|
file { $ae_conf_dir:
|
|
ensure => directory,
|
|
path => $ae_conf_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_config_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# conf.d dir
|
|
|
|
file { $ae_conf_d_dir:
|
|
ensure => directory,
|
|
path => $ae_conf_d_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_config_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# conf.modules.d
|
|
|
|
file { $ae_conf_mods_d:
|
|
ensure => directory,
|
|
path => $ae_conf_mods_d,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_config_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# /var/log/httpd
|
|
|
|
file { $ae_var_logs_dir:
|
|
ensure => directory,
|
|
path => $ae_var_logs_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0700',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_log_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# logs dir link
|
|
|
|
file { $ae_logs_dir:
|
|
ensure => link,
|
|
path => $ae_logs_dir,
|
|
target => $ae_var_logs_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0777',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_log_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# /usr/lib/httpd
|
|
|
|
file { $ae_usr_lib_dir:
|
|
ensure => directory,
|
|
path => $ae_usr_lib_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_modules_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# mods dir
|
|
|
|
file { $ae_usr_mods_dir:
|
|
ensure => directory,
|
|
path => $ae_usr_mods_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_modules_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# logs dir link
|
|
|
|
file { $ae_mods_dir:
|
|
ensure => link,
|
|
path => $ae_mods_dir,
|
|
target => $ae_usr_mods_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0777',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_modules_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# run dir
|
|
|
|
file { $ae_run_dir:
|
|
ensure => directory,
|
|
path => $ae_run_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0710',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_var_run_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
# run link
|
|
|
|
file { $ae_run_link:
|
|
ensure => link,
|
|
path => $ae_run_link,
|
|
target => $ae_run_dir,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0777',
|
|
selrange => s0,
|
|
selrole => object_r,
|
|
seltype => httpd_config_t,
|
|
seluser => system_u,
|
|
}
|
|
|
|
}
|
|
}
|