Files
confdroid_apache/manifests/params.pp

120 lines
4.9 KiB
ObjectPascal
Raw Normal View History

2017-06-19 13:34:42 +01:00
## cd_apache::params.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/>.
# @summary This class holds all parameters for the cd_apache module, which are
# inherited by all classes except defines.
# @param [string] pkg_ensure Specify which
# [package type] (https://confdroid.com/2017/05/puppet-type-package/)
# to use, i.e. `latest`, `present` or `absent`.
# @param [boolean] ae_manage_user Whether or not to manage details for the
# httpd service user. This is generally only required when using httpd on
# a number of servers sharing storage resources, i.e. NFS, where UID and GID
# settings must be same accross all nodes.
# @param [string] ae_user_name Specify the user name for the httpd user.
# only active if `ae_manage_user` is set to true.
# @param [string] ae_user_uid Specify the UID for teh httpd service user.
# only active if `ae_manage_user` is set to true.
# @param [string] ae_u_comment Specify the user comment for /etc/passwd.
# Shows up in email notofications as sender informations.
# only active if `ae_manage_user` is set to true.
# @param [string] ae_u_groups Specify any secondary groups the httpd service
# user shoould be in. Must not contain teh primary group.
# only active if `ae_manage_user` is set to true.
# @param [string] ae_user_home Specify the home of the httpd service user.
# only active if `ae_manage_user` is set to true.
# @param [string] ae_user_shell Specify the shell for teh httpd service user,
# which normally should not be allowed to log in .
# only active if `ae_manage_user` is set to true.
# @param [boolean] ae_manage_cfg Whether or not to manage the httpd
# configuration. httpd is very often a sub system used by many other services,
# and the required configuration depends on the use case. If using httpd as
# sub-service ( i.e. for phpmyadmin, Nagios etc.), the main configuration
# should be done on that end, not in cd_apache. IN that case, set `ae_manage_cfg`
# to `false`.
# @param [boolean] ae_manage_dirs Whether or not main directories required
# to run httpd should be managed. Tyically this should be set to true.
# @param [boolean] ae_allow_user_dirs Whether or not to allow user directories
# should be allowed to share content through httpd. Usually this is a security
# problem and as such should be disabled.
2017-06-19 13:34:42 +01:00
##############################################################################
class cd_apache::params (
2017-06-19 14:42:52 +01:00
$pkg_ensure = 'latest',
$ae_manage_user = false,
$ae_user_name = 'apache',
$ae_user_uid = '48',
2017-06-19 14:50:10 +01:00
$ae_u_comment = 'Apache',
2017-06-19 14:42:52 +01:00
$ae_u_groups = undef,
2017-06-19 16:18:29 +01:00
$ae_user_home = '/usr/share/httpd',
2017-06-19 14:42:52 +01:00
$ae_user_shell = '/bin/false',
2017-06-19 13:34:42 +01:00
2017-06-19 15:33:27 +01:00
# configuration files
$ae_manage_cfg = false,
$ae_manage_dirs = true,
2017-06-20 10:18:30 +01:00
$ae_allow_user_dirs = false,
2017-06-19 15:33:27 +01:00
2017-06-19 13:34:42 +01:00
) {
# installation section
2017-06-19 14:42:52 +01:00
$reqpackages = $::operatingsystem ? {
/(?i-mx:centos|fedora|redhat)/ => ['httpd','mod_ssl'],
}
# service
2017-06-19 14:45:41 +01:00
$ae_service = 'httpd'
2017-06-19 14:42:52 +01:00
2017-06-19 15:33:27 +01:00
# directories
$ae_main_dir = '/etc/httpd'
$ae_conf_dir = "${ae_main_dir}/conf"
$ae_conf_d_dir = "${ae_main_dir}/conf.d"
$ae_conf_mods_d = "${ae_main_dir}/conf.modules.d"
$ae_var_logs_dir = '/var/log/httpd'
$ae_logs_dir = "${ae_main_dir}/logs"
2017-06-19 15:35:06 +01:00
$ae_usr_lib_dir = '/usr/lib64/httpd'
2017-06-19 15:33:27 +01:00
$ae_usr_mods_dir = "${ae_usr_lib_dir}/modules"
$ae_mods_dir = "${ae_main_dir}/modules"
2017-06-19 16:07:36 +01:00
$ae_run_dir = '/run/httpd'
2017-06-19 16:00:02 +01:00
$ae_run_link = "${ae_main_dir}/run"
2017-06-19 16:24:25 +01:00
$ae_share_httpd = '/usr/share/httpd'
$ae_cache_httpd = '/var/cache/httpd'
2017-06-19 15:33:27 +01:00
# files
2017-06-19 17:06:32 +01:00
$ae_conf_file = "${ae_conf_dir}/httpd.conf"
$ae_conf_file_erb = 'cd_apache/httpd_conf.erb'
$ae_magic_file = "${ae_conf_dir}/magic"
$ae_magic_file_erb = 'cd_apache/magic.erb'
$ae_ssl_file = "${ae_conf_d_dir}/ssl.conf"
$ae_ssl_file_erb = 'cd_apache/ssl_conf.erb'
$ae_autoindex_file = "${ae_conf_d_dir}/autoindex.conf"
2017-06-20 10:18:30 +01:00
$ae_autoindex_erb = 'cd_apache/autoindex_conf.erb'
$ae_userdir_file = "${ae_conf_d_dir}/userdir.conf"
$ae_userdir_erb = 'cd_apache/userdir_conf.erb'
2017-06-19 15:33:27 +01:00
2017-06-19 13:34:42 +01:00
# includes must be last
include cd_apache::main::config
}