Skip to content

(CAT-1346) erb_to_epp conversion for mod directory #2453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

### Added

- The default disk_cache.conf.erb caches everything. [#2142](https://github.com/puppetlabs/puppetlabs-apache/pull/2142) ([Pawa2NR](https://github.com/Pawa2NR))
- The default disk_cache.conf.epp caches everything. [#2142](https://github.com/puppetlabs/puppetlabs-apache/pull/2142) ([Pawa2NR](https://github.com/Pawa2NR))

## [v6.2.0](https://github.com/puppetlabs/puppetlabs-apache/tree/v6.2.0) - 2021-05-24

Expand Down Expand Up @@ -995,7 +995,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
- (MODULES-2764) Enclose IPv6 addresses in square brackets [#1248](https://github.com/puppetlabs/puppetlabs-apache/pull/1248) ([Benedikt1992](https://github.com/Benedikt1992))
- (MODULES-2757) Adding if around ServerName in template [#1237](https://github.com/puppetlabs/puppetlabs-apache/pull/1237) ([damonconway](https://github.com/damonconway))
- (MODULES-2651) Default document root update for Ubuntu 14.04 and Debian 8 [#1235](https://github.com/puppetlabs/puppetlabs-apache/pull/1235) ([abednarik](https://github.com/abednarik))
- Update mime.conf.erb to support dynamic AddHandler AddType AddOutputF… [#1232](https://github.com/puppetlabs/puppetlabs-apache/pull/1232) ([prabin5](https://github.com/prabin5))
- Update mime.conf.epp to support dynamic AddHandler AddType AddOutputF… [#1232](https://github.com/puppetlabs/puppetlabs-apache/pull/1232) ([prabin5](https://github.com/prabin5))
- #2544 Allow multiple IP addresses per vhost [#1229](https://github.com/puppetlabs/puppetlabs-apache/pull/1229) ([Benedikt1992](https://github.com/Benedikt1992))
- RewriteLock support [#1228](https://github.com/puppetlabs/puppetlabs-apache/pull/1228) ([wickedOne](https://github.com/wickedOne))
- (MODULES-2120) Allow empty docroot [#1224](https://github.com/puppetlabs/puppetlabs-apache/pull/1224) ([DavidS](https://github.com/DavidS))
Expand Down
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5983,7 +5983,7 @@ Data type: `String`

Path to template to use for configuring mod_rpaf.

Default value: `'apache/mod/rpaf.conf.erb'`
Default value: `'apache/mod/rpaf.conf.epp'`

### <a name="apache--mod--security"></a>`apache::mod::security`

Expand Down
8 changes: 7 additions & 1 deletion manifests/mod.pp
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,19 @@
}
}

$parameters = {
'loadfiles' => $loadfiles,
'_id' => $_id,
'_path' => $_path,
}

file { $_loadfile_name:
ensure => file,
path => "${mod_dir}/${_loadfile_name}",
owner => 'root',
group => $apache::params::root_group,
mode => $apache::file_mode,
content => template('apache/mod/load.erb'),
content => epp('apache/mod/load.epp', $parameters),
require => [
Package['httpd'],
Exec["mkdir ${mod_dir}"],
Expand Down
8 changes: 7 additions & 1 deletion manifests/mod/alias.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@
apache::mod { 'alias': }

# Template uses $icons_path
$parameters = {
'icons_prefix' => $icons_prefix,
'icons_path' => $icons_path,
'icons_options' => $icons_options,
}

if $icons_path {
file { 'alias.conf':
ensure => file,
path => "${apache::mod_dir}/alias.conf",
mode => $apache::file_mode,
content => template('apache/mod/alias.conf.erb'),
content => epp('apache/mod/alias.conf.epp', $parameters),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
27 changes: 26 additions & 1 deletion manifests/mod/auth_cas.pp
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,38 @@
group => $apache::group,
}

$parameters = {
'cas_cookie_path' => $cas_cookie_path,
'cas_login_url' => $cas_login_url,
'cas_validate_url' => $cas_validate_url,
'cas_version' => $cas_version,
'cas_debug' => $cas_debug,
'cas_certificate_path' => $cas_certificate_path,
'cas_proxy_validate_url' => $cas_proxy_validate_url,
'cas_validate_server' => $cas_validate_server,
'cas_validate_depth' => $cas_validate_depth,
'cas_root_proxied_as' => $cas_root_proxied_as,
'cas_cookie_entropy' => $cas_cookie_entropy,
'cas_timeout' => $cas_timeout,
'cas_idle_timeout' => $cas_idle_timeout,
'cas_cache_clean_interval' => $cas_cache_clean_interval,
'cas_cookie_domain' => $cas_cookie_domain,
'cas_cookie_http_only' => $cas_cookie_http_only,
'cas_authoritative' => $cas_authoritative,
'cas_sso_enabled' => $cas_sso_enabled,
'cas_validate_saml' => $cas_validate_saml,
'cas_attribute_prefix' => $cas_attribute_prefix,
'cas_attribute_delimiter' => $cas_attribute_delimiter,
'cas_scrub_request_headers' => $cas_scrub_request_headers,
}

# Template uses
# - All variables beginning with cas_
file { 'auth_cas.conf':
ensure => file,
path => "${apache::mod_dir}/auth_cas.conf",
mode => $apache::file_mode,
content => template('apache/mod/auth_cas.conf.erb'),
content => epp('apache/mod/auth_cas.conf.epp', $parameters),
require => [Exec["mkdir ${apache::mod_dir}"],],
before => File[$apache::mod_dir],
notify => Class['Apache::Service'],
Expand Down
12 changes: 11 additions & 1 deletion manifests/mod/auth_mellon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,21 @@

# Template uses
# - All variables beginning with mellon_
$parameters = {
'mellon_cache_size' => $mellon_cache_size,
'mellon_cache_entry_size' => $mellon_cache_entry_size,
'mellon_lock_file' => $mellon_lock_file,
'mellon_post_directory' => $mellon_post_directory,
'mellon_post_ttl' => $mellon_post_ttl,
'mellon_post_size' => $mellon_post_size,
'mellon_post_count' => $mellon_post_count,
}

file { 'auth_mellon.conf':
ensure => file,
path => "${apache::mod_dir}/auth_mellon.conf",
mode => $apache::file_mode,
content => template('apache/mod/auth_mellon.conf.erb'),
content => epp('apache/mod/auth_mellon.conf.epp', $parameters),
require => [Exec["mkdir ${apache::mod_dir}"],],
before => File[$apache::mod_dir],
notify => Class['Apache::Service'],
Expand Down
13 changes: 12 additions & 1 deletion manifests/mod/authn_dbd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,24 @@
include apache::mod::authn_core
}

$parameters = {
'authn_dbd_dbdriver' => $authn_dbd_dbdriver,
'authn_dbd_params' => $authn_dbd_params,
'authn_dbd_min' => $authn_dbd_min,
'authn_dbd_max' => $authn_dbd_max,
'authn_dbd_keep' => $authn_dbd_keep,
'authn_dbd_exptime' => $authn_dbd_exptime,
'authn_dbd_alias' => $authn_dbd_alias,
'authn_dbd_query' => $authn_dbd_query,
}

# Template uses
# - All variables beginning with authn_dbd
file { 'authn_dbd.conf':
ensure => file,
path => "${apache::mod_dir}/authn_dbd.conf",
mode => $apache::file_mode,
content => template('apache/mod/authn_dbd.conf.erb'),
content => epp('apache/mod/authn_dbd.conf.epp', $parameters),
require => [Exec["mkdir ${apache::mod_dir}"],],
before => File[$apache::mod_dir],
notify => Class['Apache::Service'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod/authnz_ldap.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
ensure => file,
path => "${apache::mod_dir}/authnz_ldap.conf",
mode => $apache::file_mode,
content => template('apache/mod/authnz_ldap.conf.erb'),
content => epp('apache/mod/authnz_ldap.conf.epp', { 'verify_server_cert' => $verify_server_cert, }),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
4 changes: 2 additions & 2 deletions manifests/mod/autoindex.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
include apache
::apache::mod { 'autoindex': }

# Determine icon filename suffix for autoindex.conf.erb
# Determine icon filename suffix for autoindex.conf.epp
case $facts['os']['name'] {
'Debian', 'Ubuntu': {
$icon_suffix = '-20x22'
Expand All @@ -26,7 +26,7 @@
ensure => file,
path => "${apache::mod_dir}/autoindex.conf",
mode => $apache::file_mode,
content => template('apache/mod/autoindex.conf.erb'),
content => epp('apache/mod/autoindex.conf.epp', { 'icons_prefix' => $icons_prefix, 'icon_suffix' => $icon_suffix, }),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod/cgid.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
ensure => file,
path => "${apache::mod_dir}/cgid.conf",
mode => $apache::file_mode,
content => template('apache/mod/cgid.conf.erb'),
content => epp('apache/mod/cgid.conf.epp', { 'cgisock_path' => $cgisock_path }),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
15 changes: 14 additions & 1 deletion manifests/mod/cluster.pp
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,24 @@
::apache::mod { 'slotmem': }
}

$parameters = {
'ip' => $ip,
'port' => $port,
'allowed_network' => $allowed_network,
'keep_alive_timeout' => $keep_alive_timeout,
'max_keep_alive_requests' => $max_keep_alive_requests,
'enable_mcpm_receive' => $enable_mcpm_receive,
'balancer_name' => $balancer_name,
'server_advertise' => $server_advertise,
'advertise_frequency' => $advertise_frequency,
'manager_allowed_network' => $manager_allowed_network,
}

file { 'cluster.conf':
ensure => file,
path => "${apache::mod_dir}/cluster.conf",
mode => $apache::file_mode,
content => template('apache/mod/cluster.conf.erb'),
content => epp('apache/mod/cluster.conf.epp', $parameters),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod/dav_fs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
ensure => file,
path => "${apache::mod_dir}/dav_fs.conf",
mode => $apache::file_mode,
content => template('apache/mod/dav_fs.conf.erb'),
content => epp('apache/mod/dav_fs.conf.epp', { 'dav_lock' => $dav_lock }),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod/deflate.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
ensure => file,
path => "${apache::mod_dir}/deflate.conf",
mode => $apache::file_mode,
content => template('apache/mod/deflate.conf.erb'),
content => epp('apache/mod/deflate.conf.epp', { 'types' => $types, 'notes' => $notes, }),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod/dir.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
ensure => file,
path => "${apache::mod_dir}/dir.conf",
mode => $apache::file_mode,
content => template('apache/mod/dir.conf.erb'),
content => epp('apache/mod/dir.conf.epp', { 'indexes' => $indexes }),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
8 changes: 7 additions & 1 deletion manifests/mod/disk_cache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,18 @@

Class['apache::mod::cache'] -> Class['apache::mod::disk_cache']

$parameters = {
'default_cache_enable' => $default_cache_enable,
'_cache_root' => $_cache_root,
'cache_ignore_headers' => $cache_ignore_headers,
}

# Template uses $_cache_root
file { 'disk_cache.conf':
ensure => file,
path => "${apache::mod_dir}/disk_cache.conf",
mode => $apache::file_mode,
content => template('apache/mod/disk_cache.conf.erb'),
content => epp('apache/mod/disk_cache.conf.epp', $parameters),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod/dumpio.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
ensure => file,
path => "${apache::mod_dir}/dumpio.conf",
mode => $apache::file_mode,
content => template('apache/mod/dumpio.conf.erb'),
content => epp('apache/mod/dumpio.conf.epp', { 'dump_io_input' => $dump_io_input, 'dump_io_output' => $dump_io_output, }),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
14 changes: 13 additions & 1 deletion manifests/mod/event.pp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,22 @@
# - $maxsparethreads
# - $threadsperchild
# - $serverlimit
$parameters = {
'serverlimit' => $serverlimit,
'startservers' => $startservers,
'maxrequestworkers' => $maxrequestworkers,
'minsparethreads' => $minsparethreads,
'maxsparethreads' => $maxsparethreads,
'threadsperchild' => $threadsperchild,
'maxconnectionsperchild' => $maxconnectionsperchild,
'threadlimit' => $threadlimit,
'listenbacklog' => $listenbacklog,
}

file { "${apache::mod_dir}/event.conf":
ensure => file,
mode => $apache::file_mode,
content => template('apache/mod/event.conf.erb'),
content => epp('apache/mod/event.conf.epp', $parameters),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
8 changes: 7 additions & 1 deletion manifests/mod/expires.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@
# $expires_active
# $expires_default
# $expires_by_type
$parameters = {
'expires_active' => $expires_active,
'expires_default' => $expires_default,
'expires_by_type' => $expires_by_type,
}

file { 'expires.conf':
ensure => file,
path => "${apache::mod_dir}/expires.conf",
mode => $apache::file_mode,
content => template('apache/mod/expires.conf.erb'),
content => epp('apache/mod/expires.conf.epp', $parameters),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod/ext_filter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
ensure => file,
path => "${apache::mod_dir}/ext_filter.conf",
mode => $apache::file_mode,
content => template('apache/mod/ext_filter.conf.erb'),
content => epp('apache/mod/ext_filter.conf.epp', { 'ext_filter_define' => $ext_filter_define, }),
require => [Exec["mkdir ${apache::mod_dir}"],],
before => File[$apache::mod_dir],
notify => Class['Apache::Service'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/mod/fcgid.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
ensure => file,
path => "${apache::mod_dir}/${conf_name}",
mode => $apache::file_mode,
content => template('apache/mod/fcgid.conf.erb'),
content => epp('apache/mod/fcgid.conf.epp', { 'options' => $options, }),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
13 changes: 12 additions & 1 deletion manifests/mod/geoip.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,22 @@
# - scan_proxy_headers
# - scan_proxy_header_field
# - use_last_xforwarededfor_ip
$parameters = {
'enable' => $enable,
'db_file' => $db_file,
'flag' => $flag,
'output' => $output,
'enable_utf8' => $enable_utf8,
'scan_proxy_headers' => $scan_proxy_headers,
'scan_proxy_header_field' => $scan_proxy_header_field,
'use_last_xforwarededfor_ip' => $use_last_xforwarededfor_ip,
}

file { 'geoip.conf':
ensure => file,
path => "${apache::mod_dir}/geoip.conf",
mode => $apache::file_mode,
content => template('apache/mod/geoip.conf.erb'),
content => epp('apache/mod/geoip.conf.epp', $parameters),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
Expand Down
23 changes: 22 additions & 1 deletion manifests/mod/http2.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,30 @@
include apache
apache::mod { 'http2': }

$parameters = {
'h2_copy_files' => $h2_copy_files,
'h2_direct' => $h2_direct,
'h2_early_hints' => $h2_early_hints,
'h2_max_session_streams' => $h2_max_session_streams,
'h2_max_worker_idle_seconds' => $h2_max_worker_idle_seconds,
'h2_max_workers' => $h2_max_workers,
'h2_min_workers' => $h2_min_workers,
'h2_modern_tls_only' => $h2_modern_tls_only,
'h2_push' => $h2_push,
'h2_push_diary_size' => $h2_push_diary_size,
'h2_push_priority' => $h2_push_priority,
'h2_push_resource' => $h2_push_resource,
'h2_serialize_headers' => $h2_serialize_headers,
'h2_stream_max_mem_size' => $h2_stream_max_mem_size,
'h2_tls_cool_down_secs' => $h2_tls_cool_down_secs,
'h2_tls_warm_up_size' => $h2_tls_warm_up_size,
'h2_upgrade' => $h2_upgrade,
'h2_window_size' => $h2_window_size,
}

file { 'http2.conf':
ensure => file,
content => template('apache/mod/http2.conf.erb'),
content => epp('apache/mod/http2.conf.epp', $parameters),
mode => $apache::file_mode,
path => "${apache::mod_dir}/http2.conf",
owner => $apache::params::user,
Expand Down
Loading