2026-02-03 00:41:35 +01:00
|
|
|
## confdroid_apache::params.pp
|
|
|
|
|
# Module name: confdroid_apache
|
|
|
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
|
|
|
|
# @summary This class holds all parameters for the confdroid_apache module, which are
|
2017-07-07 16:15:43 +01:00
|
|
|
# inherited by all classes except defines.
|
2025-05-06 14:51:28 +02:00
|
|
|
# @param [String] pkg_ensure Specify which
|
2017-07-07 16:15:43 +01:00
|
|
|
# [package type] (https://confdroid.com/2017/05/puppet-type-package/)
|
|
|
|
|
# to use, i.e. `latest`, `present` or `absent`.
|
2025-05-06 14:51:28 +02:00
|
|
|
# @param [Boolean] ae_manage_user Whether or not to manage details for the
|
2017-07-07 16:15:43 +01:00
|
|
|
# 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
|
2025-05-06 14:51:28 +02:00
|
|
|
# settings must be same across 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 the httpd service user.
|
2017-07-07 16:15:43 +01:00
|
|
|
# only active if `ae_manage_user` is set to true.
|
2025-05-06 14:51:28 +02:00
|
|
|
# @param [String] ae_u_comment Specify the user comment for /etc/passwd.
|
|
|
|
|
# Shows up in email notifications as sender information.
|
2017-07-07 16:15:43 +01:00
|
|
|
# only active if `ae_manage_user` is set to true.
|
2025-05-06 14:51:28 +02:00
|
|
|
# @param [String] ae_u_groups Specify any secondary groups the httpd service
|
|
|
|
|
# user should be in. Must not contain the primary group.
|
2017-07-07 16:15:43 +01:00
|
|
|
# only active if `ae_manage_user` is set to true.
|
2025-05-06 14:51:28 +02:00
|
|
|
# @param [String] ae_user_home Specify the home of the httpd service user.
|
2017-07-07 16:15:43 +01:00
|
|
|
# only active if `ae_manage_user` is set to true.
|
2025-05-06 14:51:28 +02:00
|
|
|
# @param [String] ae_user_shell Specify the shell for the httpd service user,
|
2017-07-07 16:15:43 +01:00
|
|
|
# which normally should not be allowed to log in .
|
|
|
|
|
# only active if `ae_manage_user` is set to true.
|
2025-05-06 14:51:28 +02:00
|
|
|
# @param [Boolean] ae_manage_cfg Whether or not to manage the httpd
|
2017-07-07 16:15:43 +01:00
|
|
|
# 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
|
2026-02-03 00:41:35 +01:00
|
|
|
# should be done on that end, not in confdroid_apache. IN that case, set `ae_manage_cfg`
|
2017-07-07 16:15:43 +01:00
|
|
|
# to `false`.
|
2025-05-06 14:51:28 +02:00
|
|
|
# @param [Boolean] ae_manage_dirs Whether or not main directories required
|
|
|
|
|
# to run httpd should be managed. Typically this should be set to true.
|
|
|
|
|
# @param [Boolean] ae_allow_user_dirs Whether or not to allow user directories
|
2017-07-07 16:15:43 +01:00
|
|
|
# should be allowed to share content through httpd. Usually this is a security
|
|
|
|
|
# problem and as such should be disabled.
|
2025-05-06 14:51:28 +02:00
|
|
|
# @param [Boolean] ae_incl_target whether or not to allow nagios monitoring.
|
|
|
|
|
# @param [String] ae_order_no the order number for the firewall rules
|
|
|
|
|
# @param [String] ae_http_port the port to use for the http protocol
|
|
|
|
|
# @param [String] ae_https_port the port to use for the https protocol
|
|
|
|
|
# @param [String] ae_target_service which service to monitor with nagios
|
|
|
|
|
# @param [Boolean] ae_manage_fw whether to manage firewall settings
|
|
|
|
|
# @param [String] reqpackages List of packages to install.
|
2018-04-20 11:30:48 +02:00
|
|
|
###########################################################################
|
2026-02-03 00:41:35 +01:00
|
|
|
class confdroid_apache::params (
|
2017-06-19 13:34:42 +01:00
|
|
|
|
2018-08-26 17:42:08 +02:00
|
|
|
# installation
|
2025-05-06 14:51:28 +02:00
|
|
|
String $pkg_ensure = 'latest',
|
|
|
|
|
String $reqpackages = ['httpd','mod_ssl'],
|
2017-06-19 14:42:52 +01:00
|
|
|
|
2025-05-06 14:51:28 +02:00
|
|
|
Boolean $ae_manage_user = false,
|
2017-06-19 14:42:52 +01:00
|
|
|
|
2025-05-06 14:51:28 +02:00
|
|
|
String $ae_user_name = 'apache',
|
|
|
|
|
String $ae_user_uid = '48',
|
|
|
|
|
String $ae_u_comment = 'Apache',
|
|
|
|
|
String $ae_u_groups = undef,
|
|
|
|
|
String $ae_user_home = '/usr/share/httpd',
|
|
|
|
|
String $ae_user_shell = '/bin/false',
|
2017-06-19 13:34:42 +01:00
|
|
|
|
2017-06-19 15:33:27 +01:00
|
|
|
# configuration files
|
2025-05-06 14:51:28 +02:00
|
|
|
Boolean $ae_manage_cfg = false,
|
|
|
|
|
Boolean $ae_manage_dirs = true,
|
|
|
|
|
Boolean $ae_allow_user_dirs = false,
|
2017-06-19 15:33:27 +01:00
|
|
|
|
2018-04-20 10:06:12 +02:00
|
|
|
# nagios
|
2025-05-06 14:51:28 +02:00
|
|
|
Boolean $ae_incl_target = true,
|
|
|
|
|
String $ae_target_service = '/etc/nagios/conf.d/httpd_service.cfg',
|
2018-04-20 10:06:12 +02:00
|
|
|
|
2018-04-20 11:30:48 +02:00
|
|
|
# firewall
|
2025-05-06 14:51:28 +02:00
|
|
|
Boolean $ae_manage_fw = false,
|
|
|
|
|
String $ae_order_no = '50',
|
|
|
|
|
String $ae_http_port = '80',
|
|
|
|
|
String $ae_https_port = '443',
|
2018-04-20 11:30:48 +02:00
|
|
|
|
2017-06-19 13:34:42 +01:00
|
|
|
) {
|
2017-06-19 14:42:52 +01:00
|
|
|
# service
|
2025-05-06 14:51:28 +02:00
|
|
|
$ae_service = 'httpd'
|
2017-06-19 14:42:52 +01:00
|
|
|
|
2017-06-19 15:33:27 +01:00
|
|
|
# directories
|
2025-05-06 14:51:28 +02:00
|
|
|
$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"
|
|
|
|
|
$ae_usr_lib_dir = '/usr/lib64/httpd'
|
|
|
|
|
$ae_usr_mods_dir = "${ae_usr_lib_dir}/modules"
|
|
|
|
|
$ae_mods_dir = "${ae_main_dir}/modules"
|
|
|
|
|
$ae_run_dir = '/run/httpd'
|
|
|
|
|
$ae_run_link = "${ae_main_dir}/run"
|
|
|
|
|
$ae_share_httpd = '/usr/share/httpd'
|
|
|
|
|
$ae_cache_httpd = '/var/cache/httpd'
|
2017-06-19 15:33:27 +01:00
|
|
|
|
|
|
|
|
# files
|
2025-05-06 14:51:28 +02:00
|
|
|
$ae_conf_file = "${ae_conf_dir}/httpd.conf"
|
2026-02-03 00:41:35 +01:00
|
|
|
$ae_conf_file_erb = 'confdroid_apache/httpd_conf.erb'
|
2025-05-06 14:51:28 +02:00
|
|
|
$ae_magic_file = "${ae_conf_dir}/magic"
|
2026-02-03 00:41:35 +01:00
|
|
|
$ae_magic_file_erb = 'confdroid_apache/magic.erb'
|
2025-05-06 14:51:28 +02:00
|
|
|
$ae_ssl_file = "${ae_conf_d_dir}/ssl.conf"
|
2026-02-03 00:41:35 +01:00
|
|
|
$ae_ssl_file_erb = 'confdroid_apache/ssl_conf.erb'
|
2025-05-06 14:51:28 +02:00
|
|
|
$ae_autoindex_file = "${ae_conf_d_dir}/autoindex.conf"
|
2026-02-03 00:41:35 +01:00
|
|
|
$ae_autoindex_erb = 'confdroid_apache/autoindex_conf.erb'
|
2025-05-06 14:51:28 +02:00
|
|
|
$ae_userdir_file = "${ae_conf_d_dir}/userdir.conf"
|
2026-02-03 00:41:35 +01:00
|
|
|
$ae_userdir_erb = 'confdroid_apache/userdir_conf.erb'
|
2025-05-06 14:51:28 +02:00
|
|
|
$ae_index_file = '/var/www/html/index.html'
|
2026-02-03 00:41:35 +01:00
|
|
|
$ae_index_erb = 'confdroid_apache/index_html.erb'
|
2017-06-19 15:33:27 +01:00
|
|
|
|
2017-06-19 13:34:42 +01:00
|
|
|
# includes must be last
|
2026-02-03 00:41:35 +01:00
|
|
|
include confdroid_apache::main::config
|
2017-06-19 13:34:42 +01:00
|
|
|
}
|