Skip to content

Commit 5c7c430

Browse files
authored
Merge branch 'main' into raise-puppet-version
2 parents 186c729 + 4cfcbbd commit 5c7c430

27 files changed

+553
-297
lines changed

REFERENCE.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ Default value: `true`
346346

347347
##### <a name="-apache--default_mods"></a>`default_mods`
348348

349-
Data type: `Variant[Array, Boolean]`
349+
Data type: `Variant[Array[String[1]], Boolean]`
350350

351351
Determines whether to configure and enable a set of default Apache modules depending on
352352
your operating system.<br />
@@ -356,7 +356,14 @@ on your operating system, and you can declare any other modules separately using
356356
If `true`, Puppet installs additional modules, depending on the operating system and
357357
the value of the `mpm_module` parameter. Because these lists of
358358
modules can change frequently, consult the Puppet module's code for up-to-date lists.<br />
359-
If this parameter contains an array, Puppet instead enables all passed Apache modules.
359+
If this parameter contains an array, Puppet will enable all the Apache modules passed in it.
360+
Passing the values as an array of strings provides the flexibility to override the default mods and install modules defined in `$default_mods`.
361+
For example, with array of string:<br />
362+
```puppet
363+
class { 'apache':
364+
default_mods => ['cache', 'info', 'mime_magic']
365+
}
366+
```
360367

361368
Default value: `true`
362369

manifests/confd/no_accf.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
file { 'no-accf.conf':
88
ensure => 'file',
99
path => "${apache::confd_dir}/no-accf.conf",
10-
content => template('apache/confd/no-accf.conf.erb'),
10+
content => epp('apache/confd/no-accf.conf.epp'),
1111
require => Exec["mkdir ${apache::confd_dir}"],
1212
before => File[$apache::confd_dir],
1313
}

manifests/default_mods.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#
44
# @api private
55
class apache::default_mods (
6-
Boolean $all = true,
7-
Optional[Variant[Array[String], String]] $mods = undef,
8-
Boolean $use_systemd = $apache::use_systemd,
6+
Boolean $all = true,
7+
Optional[Variant[Array[String[1]], String[1]]] $mods = undef,
8+
Boolean $use_systemd = $apache::use_systemd,
99
) {
1010
# These are modules required to run the default configuration.
1111
# They are not configurable at this time, so we just include
@@ -125,6 +125,7 @@
125125
include apache::mod::negotiation
126126
include apache::mod::setenvif
127127
include apache::mod::auth_basic
128+
include apache::mod::log_forensic
128129

129130
# filter is needed by mod_deflate
130131
include apache::mod::filter

manifests/fastcgi/server.pp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,24 @@
4848
$socket = $host
4949
}
5050

51+
$parameters = {
52+
'timeout' => $timeout,
53+
'flush' => $flush,
54+
'socket' => $socket,
55+
'host' => $host,
56+
'pass_header' => $pass_header,
57+
'faux_path' => $faux_path,
58+
'fcgi_alias' => $fcgi_alias,
59+
'file_type' => $file_type,
60+
}
61+
5162
file { "fastcgi-pool-${name}.conf":
5263
ensure => file,
5364
path => "${apache::confd_dir}/fastcgi-pool-${name}.conf",
5465
owner => 'root',
5566
group => $apache::params::root_group,
5667
mode => $apache::file_mode,
57-
content => template('apache/fastcgi/server.erb'),
68+
content => epp('apache/fastcgi/server.epp', $parameters),
5869
require => Exec["mkdir ${apache::confd_dir}"],
5970
before => File[$apache::confd_dir],
6071
notify => Class['apache::service'],

manifests/init.pp

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@
459459
class apache (
460460
String $apache_name = $apache::params::apache_name,
461461
String $service_name = $apache::params::service_name,
462-
Variant[Array, Boolean] $default_mods = true,
462+
Variant[Array[String[1]], Boolean] $default_mods = true,
463463
Boolean $default_vhost = true,
464464
Optional[String] $default_charset = undef,
465465
Boolean $default_confd_files = true,
@@ -727,7 +727,7 @@
727727
}
728728
concat::fragment { 'Apache ports header':
729729
target => $ports_file,
730-
content => template('apache/ports_header.erb'),
730+
content => epp('apache/ports_header.epp'),
731731
}
732732

733733
if $apache::conf_dir and $apache::params::conf_file {
@@ -782,10 +782,57 @@
782782
# - $server_signature
783783
# - $trace_enable
784784
# - $root_directory_secured
785+
$parameters = {
786+
'server_tokens' => $server_tokens,
787+
'server_signature' => $server_signature,
788+
'trace_enable' => $trace_enable,
789+
'servername' => $servername,
790+
'server_root' => $server_root,
791+
'serveradmin' => $serveradmin,
792+
'pidfile' => $pidfile,
793+
'timeout' => $timeout,
794+
'keepalive' => $keepalive,
795+
'max_keepalive_requests' => $max_keepalive_requests,
796+
'keepalive_timeout' => $keepalive_timeout,
797+
'limitreqfieldsize' => $limitreqfieldsize,
798+
'limitreqfields' => $limitreqfields,
799+
'limitreqline' => $limitreqline,
800+
'http_protocol_options' => $http_protocol_options,
801+
'protocols' => $protocols,
802+
'protocols_honor_order' => $protocols_honor_order,
803+
'user' => $user,
804+
'group' => $group,
805+
'root_directory_options' => $root_directory_options,
806+
'root_directory_secured' => $root_directory_secured,
807+
'default_charset' => $default_charset,
808+
'hostname_lookups' => $hostname_lookups,
809+
'error_log' => $error_log,
810+
'logroot' => $logroot,
811+
'log_level' => $log_level,
812+
'sendfile' => $sendfile,
813+
'allow_encoded_slashes' => $allow_encoded_slashes,
814+
'file_e_tag' => $file_e_tag,
815+
'use_canonical_name' => $use_canonical_name,
816+
'apxs_workaround' => $apxs_workaround,
817+
'mod_load_dir' => $mod_load_dir,
818+
'confd_dir' => $confd_dir,
819+
'vhost_load_dir' => $vhost_load_dir,
820+
'vhost_include_pattern' => $vhost_include_pattern,
821+
'ports_file' => $ports_file,
822+
'log_formats' => $log_formats,
823+
'conf_enabled' => $conf_enabled,
824+
'ldap_verify_server_cert' => $ldap_verify_server_cert,
825+
'ldap_trusted_mode' => $ldap_trusted_mode,
826+
'error_documents' => $error_documents,
827+
'error_documents_path' => $error_documents_path,
828+
}
829+
830+
notice $conf_template
831+
785832
file { "${apache::conf_dir}/${apache::params::conf_file}":
786833
ensure => file,
787834
mode => $apache::file_mode,
788-
content => template($conf_template),
835+
content => epp($conf_template, $parameters),
789836
notify => Class['Apache::Service'],
790837
require => [Package['httpd'], Concat[$ports_file]],
791838
}

manifests/listen.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
# Template uses: $listen_addr_port
1111
concat::fragment { "Listen ${listen_addr_port}":
1212
target => $apache::ports_file,
13-
content => template('apache/listen.erb'),
13+
content => epp('apache/listen.epp', { 'listen_addr_port' => $listen_addr_port }),
1414
}
1515
}

manifests/mod/log_forensic.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# @summary
2+
# Installs `mod_log_forensic`
3+
#
4+
# @see https://httpd.apache.org/docs/current/mod/mod_log_forensic.html for additional documentation.
5+
#
6+
class apache::mod::log_forensic {
7+
include apache
8+
apache::mod { 'log_forensic': }
9+
}

manifests/mod/remoteip.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
#
5252
class apache::mod::remoteip (
5353
String $header = 'X-Forwarded-For',
54-
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $internal_proxy = undef,
55-
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $proxy_ips = undef,
54+
Optional[Array[Stdlib::Host]] $internal_proxy = undef,
55+
Optional[Array[Stdlib::Host]] $proxy_ips = undef,
5656
Optional[Stdlib::Absolutepath] $internal_proxy_list = undef,
5757
Optional[String] $proxies_header = undef,
5858
Boolean $proxy_protocol = false,
59-
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $proxy_protocol_exceptions = undef,
59+
Optional[Array[Stdlib::Host]] $proxy_protocol_exceptions = undef,
6060
Optional[Array[Stdlib::Host]] $trusted_proxy = undef,
6161
Optional[Array[Stdlib::Host]] $trusted_proxy_ips = undef,
6262
Optional[Stdlib::Absolutepath] $trusted_proxy_list = undef,

manifests/namevirtualhost.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
# Template uses: $addr_port
1111
concat::fragment { "NameVirtualHost ${addr_port}":
1212
target => $apache::ports_file,
13-
content => template('apache/namevirtualhost.erb'),
13+
content => epp('apache/namevirtualhost.epp', { 'addr_port' => $addr_port }),
1414
}
1515
}

0 commit comments

Comments
 (0)