Puppet Class: cd_apache::params

Summary

This class holds all parameters for the cd_apache module, which are inherited by all classes except defines.

Overview

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 www.gnu.org/licenses/.

Parameters:

  • pkg_ensure (string) (defaults to: 'latest')

    Specify which package type to use, i.e. latest, present or absent.

  • ae_manage_user (boolean) (defaults to: false)

    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.

  • ae_user_name (string) (defaults to: 'apache')

    Specify the user name for the httpd user. only active if ae_manage_user is set to true.

  • ae_user_uid (string) (defaults to: '48')

    Specify the UID for teh httpd service user. only active if ae_manage_user is set to true.

  • ae_u_comment (string) (defaults to: 'Apache')

    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.

  • ae_u_groups (string) (defaults to: undef)

    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.

  • ae_user_home (string) (defaults to: '/usr/share/httpd')

    Specify the home of the httpd service user. only active if ae_manage_user is set to true.

  • ae_user_shell (string) (defaults to: '/bin/false')

    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.

  • ae_manage_cfg (boolean) (defaults to: false)

    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.

  • ae_manage_dirs (boolean) (defaults to: true)

    Whether or not main directories required to run httpd should be managed. Tyically this should be set to true.

  • ae_allow_user_dirs (boolean) (defaults to: false)

    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.

  • ae_incl_target (boolean) (defaults to: true)

    whether or not to allow nagios monitoring.

  • ae_target_service (Any) (defaults to: '/etc/nagios/conf.d/httpd_service.cfg')


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
126
# File 'manifests/params.pp', line 59

class cd_apache::params (

$pkg_ensure         = 'latest',

$ae_manage_user     = false,

$ae_user_name       = 'apache',
$ae_user_uid        = '48',
$ae_u_comment       = 'Apache',
$ae_u_groups        = undef,
$ae_user_home       = '/usr/share/httpd',
$ae_user_shell      = '/bin/false',

# configuration files
$ae_manage_cfg      = false,
$ae_manage_dirs     = true,
$ae_allow_user_dirs = false,

# nagios
$ae_incl_target     = true,
$ae_target_service  = '/etc/nagios/conf.d/httpd_service.cfg',

) {

# installation section

$reqpackages  = $::operatingsystem ? {
    /(?i-mx:centos|fedora|redhat)/ => ['httpd','mod_ssl'],
  }

# service
$ae_service         = 'httpd'

# 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"
$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'


# files
$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"
$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'
$ae_index_file      = '/var/www/html/index.html'
$ae_index_erb       = 'cd_apache/index_html.erb'

# includes must be last

  include cd_apache::main::config

}