Skip to content

Commit

Permalink
(CAT-1449) - Cleanup for deprecated content from module
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramesh7 committed Sep 22, 2023
1 parent d1a79ed commit c2a7444
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 421 deletions.
27 changes: 27 additions & 0 deletions HISTORY.md
@@ -1,3 +1,30 @@
## 11.0.0
### Summary
This is release where have done cleanup as well as some feature addition.
#### Added
- Parameters for `apache::mod::passenger`:
- `passenger_max_request_queue_time`
- `passenger_admin_panel_url`
- `passenger_admin_panel_auth_type`
- `passenger_admin_panel_username`
- `passenger_admin_panel_password`
- `passenger_app_log_file`
- `passenger_dump_config_manifest`
#### Removed
- Parameters for `apache::mod::passenger`:
- `rails_ruby`
- `rails_base_uri`
- `rack_base_uri`
- `rails_user_switching`
- `rails_default_user`
- `rails_allow_mod_rewrite`
- `rails_spawn_method`
- `rails_auto_detect`
- `rack_auto_detect`
- `wsgi_auto_detect`
- `rails_app_spawner_idle_time`
- `rails_framework_app_spawner_idle_time`

## 3.2.0
### Summary
This is a clean release to prepare for several planned backwards incompatible changes.
Expand Down
226 changes: 67 additions & 159 deletions REFERENCE.md

Large diffs are not rendered by default.

29 changes: 5 additions & 24 deletions manifests/init.pp
Expand Up @@ -105,11 +105,6 @@
# ```
# **Note**: SSL virtual hosts only respond to HTTPS queries.
#
# @param default_type
# _Apache 2.2 only_. Sets the MIME `content-type` sent if the server cannot otherwise
# determine an appropriate `content-type`. This directive is deprecated in Apache 2.4 and
# newer, and is only for backwards compatibility in configuration files.
#
# @param default_vhost
# Configures a default virtual host when the class is declared.<br />
# To configure customized virtual hosts, set this parameter's
Expand Down Expand Up @@ -423,10 +418,6 @@
#
# @param ip
# Specifies the ip address
#
# @param purge_vdir
# Removes all other Apache configs and virtual hosts.<br />
# > **Note**: This parameter is deprecated in favor of the `purge_configs` parameter.<br />
#
# @param conf_enabled
# Whether the additional config files in `/etc/apache2/conf-enabled` should be managed.
Expand Down Expand Up @@ -472,7 +463,6 @@
Optional[Stdlib::Absolutepath] $default_ssl_crl = undef,
Optional[String] $default_ssl_crl_check = undef,
Boolean $default_ssl_reload_on_change = false,
String $default_type = 'none',
Optional[Variant[Array, String]] $dev_packages = $apache::params::dev_packages,
Optional[String] $ip = undef,
Boolean $service_enable = true,
Expand All @@ -481,7 +471,6 @@
Optional[String] $service_restart = undef,
Boolean $purge_configs = true,
Optional[Boolean] $purge_vhost_dir = undef,
Boolean $purge_vdir = false,
Optional[String[1]] $serveradmin = undef,
Apache::OnOff $sendfile = 'On',
Optional[Apache::OnOff] $ldap_verify_server_cert = undef,
Expand Down Expand Up @@ -599,17 +588,9 @@
service_restart => $service_restart,
}

# Deprecated backwards-compatibility
if $purge_vdir {
warning('Class[\'apache\'] parameter purge_vdir is deprecated in favor of purge_configs')
$purge_confd = $purge_vdir
} else {
$purge_confd = $purge_configs
}

# Set purge vhostd appropriately
if $purge_vhost_dir == undef {
$purge_vhostd = $purge_confd
$purge_vhostd = $purge_configs
} else {
$purge_vhostd = $purge_vhost_dir
}
Expand All @@ -627,8 +608,8 @@
file { $confd_dir:
ensure => directory,
recurse => true,
purge => $purge_confd,
force => $purge_confd,
purge => $purge_configs,
force => $purge_configs,
notify => Class['Apache::Service'],
require => Package['httpd'],
}
Expand All @@ -637,8 +618,8 @@
file { $conf_enabled:
ensure => directory,
recurse => true,
purge => $purge_confd,
force => $purge_confd,
purge => $purge_configs,
force => $purge_configs,
notify => Class['Apache::Service'],
require => Package['httpd'],
}
Expand Down
197 changes: 74 additions & 123 deletions manifests/mod/passenger.pp

Large diffs are not rendered by default.

37 changes: 1 addition & 36 deletions manifests/vhost.pp
Expand Up @@ -96,11 +96,6 @@
# the `aliases` parameter. As described in the `mod_alias` documentation, add more specific
# `alias`, `aliasmatch`, `scriptalias` or `scriptaliasmatch` parameters before the more
# general ones to avoid shadowing.<BR />
# > **Note**: Use the `aliases` parameter instead of the `scriptaliases` parameter because
# you can precisely control the order of various alias directives. Defining `ScriptAliases`
# using the `scriptaliases` parameter means *all* `ScriptAlias` directives will come after
# *all* `Alias` directives, which can lead to `Alias` directives shadowing `ScriptAlias`
# directives. This often causes problems; for example, this could cause problems with Nagios.<BR />
# If `apache::mod::passenger` is loaded and `PassengerHighPerformance` is `true`, the `Alias`
# directive might not be able to honor the `PassengerEnabled => off` statement. See
# [this article](http://www.conandalton.net/2010/06/passengerenabled-off-not-working.html) for details.
Expand Down Expand Up @@ -1095,34 +1090,6 @@
# Defines a directory of CGI scripts to be aliased to the path '/cgi-bin', such as
# '/usr/scripts'.
#
# @param scriptaliases
# > **Note**: This parameter is deprecated in favor of the `aliases` parameter.<br />
# Passes an array of hashes to the virtual host to create either ScriptAlias or
# ScriptAliasMatch statements per the `mod_alias` documentation.
# ``` puppet
# scriptaliases => [
# {
# alias => '/myscript',
# path => '/usr/share/myscript',
# },
# {
# aliasmatch => '^/foo(.*)',
# path => '/usr/share/fooscripts$1',
# },
# {
# aliasmatch => '^/bar/(.*)',
# path => '/usr/share/bar/wrapper.sh/$1',
# },
# {
# alias => '/neatscript',
# path => '/usr/share/neatscript',
# },
# ]
# ```
# The ScriptAlias and ScriptAliasMatch directives are created in the order specified.
# As with [Alias and AliasMatch](#aliases) directives, specify more specific aliases
# before more general ones to avoid shadowing.
#
# @param serveradmin
# Specifies the email address Apache displays when it renders one of its error pages.
#
Expand Down Expand Up @@ -1811,7 +1778,6 @@
Variant[Array[Hash], String] $error_documents = [],
Optional[Variant[Stdlib::Absolutepath, Enum['disabled']]] $fallbackresource = undef,
Optional[String] $scriptalias = undef,
Array[Hash] $scriptaliases = [],
Optional[Integer] $limitreqfieldsize = undef,
Optional[Integer] $limitreqfields = undef,
Optional[Integer] $limitreqline = undef,
Expand Down Expand Up @@ -2552,9 +2518,8 @@
}

# Template uses:
# - $scriptaliases
# - $scriptalias
if ($scriptalias or !empty($scriptaliases)) and $ensure == 'present' {
if $scriptalias and $ensure == 'present' {
include apache::mod::alias

concat::fragment { "${name}-scriptalias":
Expand Down
9 changes: 0 additions & 9 deletions spec/acceptance/vhost_spec.rb
Expand Up @@ -816,10 +816,6 @@ class { 'apache': }
docroot => '/tmp',
proxy_dest => 'http://testproxy',
}
apache::vhost { 'test.scriptaliases':
docroot => '/tmp',
scriptaliases => [{ alias => '/myscript', path => '/usr/share/myscript', }],
}
apache::vhost { 'test.aliases':
docroot => '/tmp',
aliases => [
Expand Down Expand Up @@ -930,11 +926,6 @@ class { 'apache': }
it { is_expected.to contain 'ProxyPass / http://testproxy/' }
end

describe file("#{apache_hash['vhost_dir']}/25-test.scriptaliases.conf") do
it { is_expected.to be_file }
it { is_expected.to contain 'ScriptAlias /myscript "/usr/share/myscript"' }
end

describe file("#{apache_hash['vhost_dir']}/25-test.aliases.conf") do
it { is_expected.to be_file }
it { is_expected.to contain 'Alias /image "/ftp/pub/image"' }
Expand Down
22 changes: 9 additions & 13 deletions spec/classes/mod/passenger_spec.rb
Expand Up @@ -27,8 +27,13 @@
passenger_config_options = {
'passenger_allow_encoded_slashes' => { type: 'OnOff', pass_opt: :PassengerAllowEncodedSlashes },
'passenger_anonymous_telemetry_proxy' => { type: 'String', pass_opt: :PassengerAnonymousTelemetryProxy },
'passenger_admin_panel_url' => { type: 'String', pass_opt: :PassengerAdminPanelUrl },
'passenger_admin_panel_auth_type' => { type: 'String', pass_opt: :PassengerAdminPanelAuthType },
'passenger_admin_panel_username' => { type: 'String', pass_opt: :PassengerAdminPanelUsername },
'passenger_admin_panel_password' => { type: 'String', pass_opt: :PassengerAdminPanelPassword },
'passenger_app_env' => { type: 'String', pass_opt: :PassengerAppEnv },
'passenger_app_group_name' => { type: 'String', pass_opt: :PassengerAppGroupName },
'passenger_app_log_file' => { type: 'String', pass_opt: :PassengerAppLogFile },
'passenger_app_root' => { type: 'FullPath', pass_opt: :PassengerAppRoot },
'passenger_app_type' => { type: 'String', pass_opt: :PassengerAppType },
'passenger_base_uri' => { type: 'URI', pass_opt: :PassengerBaseURI },
Expand All @@ -44,6 +49,7 @@
'passenger_disable_anonymous_telemetry' => { type: 'Boolean', pass_opt: :PassengerDisableAnonymousTelemetry },
'passenger_disable_log_prefix' => { type: 'Boolean', pass_opt: :PassengerDisableLogPrefix },
'passenger_disable_security_update_check' => { type: 'OnOff', pass_opt: :PassengerDisableSecurityUpdateCheck },
'passenger_dump_config_manifest' => { type: 'String', pass_opt: :PassengerDumpConfigManifest },
'passenger_enabled' => { type: 'OnOff', pass_opt: :PassengerEnabled },
'passenger_error_override' => { type: 'OnOff', pass_opt: :PassengerErrorOverride },
'passenger_file_descriptor_log_file' => { type: 'FullPath', pass_opt: :PassengerFileDescriptorLogFile },
Expand All @@ -63,6 +69,7 @@
'passenger_max_pool_size' => { type: 'Integer', pass_opt: :PassengerMaxPoolSize },
'passenger_max_preloader_idle_time' => { type: 'Integer', pass_opt: :PassengerMaxPreloaderIdleTime },
'passenger_max_request_queue_size' => { type: 'Integer', pass_opt: :PassengerMaxRequestQueueSize },
'passenger_max_request_queue_time' => { type: 'Integer', pass_opt: :PassengerMaxRequestQueueTime },
'passenger_max_request_time' => { type: 'Integer', pass_opt: :PassengerMaxRequestTime },
'passenger_max_requests' => { type: 'Integer', pass_opt: :PassengerMaxRequests },
'passenger_memory_limit' => { type: 'Integer', pass_opt: :PassengerMemoryLimit },
Expand Down Expand Up @@ -94,22 +101,11 @@
'passenger_use_global_queue' => { type: 'String', pass_opt: :PassengerUseGlobalQueue },
'passenger_user' => { type: 'String', pass_opt: :PassengerUser },
'passenger_user_switching' => { type: 'OnOff', pass_opt: :PassengerUserSwitching },
'rack_auto_detect' => { type: 'String', pass_opt: :RackAutoDetect },
'rack_autodetect' => { type: 'String', pass_opt: :RackAutoDetect },
'rack_base_uri' => { type: 'String', pass_opt: :RackBaseURI },
'rack_env' => { type: 'String', pass_opt: :RackEnv },
'rails_allow_mod_rewrite' => { type: 'String', pass_opt: :RailsAllowModRewrite },
'rails_app_spawner_idle_time' => { type: 'String', pass_opt: :RailsAppSpawnerIdleTime },
'rails_auto_detect' => { type: 'String', pass_opt: :RailsAutoDetect },
'rails_autodetect' => { type: 'String', pass_opt: :RailsAutoDetect },
'rails_base_uri' => { type: 'String', pass_opt: :RailsBaseURI },
'rails_default_user' => { type: 'String', pass_opt: :RailsDefaultUser },
'rails_env' => { type: 'String', pass_opt: :RailsEnv },
'rails_framework_spawner_idle_time' => { type: 'String', pass_opt: :RailsFrameworkSpawnerIdleTime },
'rails_ruby' => { type: 'String', pass_opt: :RailsRuby },
'rails_spawn_method' => { type: 'String', pass_opt: :RailsSpawnMethod },
'rails_user_switching' => { type: 'String', pass_opt: :RailsUserSwitching },
'wsgi_auto_detect' => { type: 'String', pass_opt: :WsgiAutoDetect }
'rails_framework_spawner_idle_time' => { type: 'String', pass_opt: :RailsFrameworkSpawnerIdleTime }
}
passenger_config_options.each do |config_option, config_hash|
puppetized_config_option = config_option
Expand Down Expand Up @@ -242,7 +238,7 @@
let :params do
{
passenger_installed_version: '5.0.0',
rails_ruby: '/some/path/to/ruby'
passenger_ruby: '/some/path/to/ruby'
}
end

Expand Down
10 changes: 0 additions & 10 deletions spec/defines/vhost_spec.rb
Expand Up @@ -324,16 +324,6 @@
'error_documents' => 'true',
'fallbackresource' => '/index.php',
'scriptalias' => '/usr/lib/cgi-bin',
'scriptaliases' => [
{
'alias' => '/myscript',
'path' => '/usr/share/myscript'
},
{
'aliasmatch' => '^/foo(.*)',
'path' => '/usr/share/fooscripts$1'
},
],
'limitreqfieldsize' => 8190,
'limitreqfields' => 100,
'limitreqline' => 8190,
Expand Down
54 changes: 21 additions & 33 deletions templates/mod/passenger.conf.epp
Expand Up @@ -7,12 +7,27 @@
<%- if $passenger_anonymous_telemetry_proxy { -%>
PassengerAnonymousTelemetryProxy <%= $passenger_anonymous_telemetry_proxy %>
<%- } -%>
<%- if $passenger_admin_panel_url { -%>
PassengerAdminPanelUrl <%= $passenger_admin_panel_url %>
<%- } -%>
<%- if $passenger_admin_panel_auth_type { -%>
PassengerAdminPanelAuthType <%= $passenger_admin_panel_auth_type %>
<%- } -%>
<%- if $passenger_admin_panel_username { -%>
PassengerAdminPanelUsername <%= $passenger_admin_panel_username %>
<%- } -%>
<%- if $passenger_admin_panel_password { -%>
PassengerAdminPanelPassword <%= $passenger_admin_panel_password %>
<%- } -%>
<%- if $passenger_app_env { -%>
PassengerAppEnv <%= $passenger_app_env %>
<%- } -%>
<%- if $passenger_app_group_name { -%>
PassengerAppGroupName <%= $passenger_app_group_name %>
<%- } -%>
<%- if $passenger_app_log_file { -%>
PassengerAppLogFile <%= $passenger_app_log_file %>
<%- } -%>
<%- if $passenger_app_root { -%>
PassengerAppRoot "<%= $passenger_app_root %>"
<%- } -%>
Expand Down Expand Up @@ -58,6 +73,9 @@
<%- if $passenger_disable_security_update_check { -%>
PassengerDisableSecurityUpdateCheck <%= $passenger_disable_security_update_check %>
<%- } -%>
<%- if $passenger_dump_config_manifest { -%>
PassengerDumpConfigManifest <%= $passenger_dump_config_manifest %>
<%- } -%>
<%- if $passenger_enabled { -%>
PassengerEnabled <%= $passenger_enabled %>
<%- } -%>
Expand Down Expand Up @@ -115,6 +133,9 @@
<%- if $passenger_max_request_queue_size { -%>
PassengerMaxRequestQueueSize <%= $passenger_max_request_queue_size %>
<%- } -%>
<%- if $passenger_max_request_queue_time { -%>
PassengerMaxRequestQueueTime <%= $passenger_max_request_queue_time %>
<%- } -%>
<%- if $passenger_max_request_time { -%>
PassengerMaxRequestTime <%= $passenger_max_request_time %>
<%- } -%>
Expand Down Expand Up @@ -210,48 +231,15 @@
<%- if $passenger_user_switching { -%>
PassengerUserSwitching <%= $passenger_user_switching %>
<%- } -%>
<%- if $rack_auto_detect { -%>
RackAutoDetect <%= $rack_auto_detect %>
<%- } -%>
<%- if $rack_base_uri { -%>
RackBaseURI <%= $rack_base_uri %>
<%- } -%>
<%- if $rack_env { -%>
RackEnv <%= $rack_env %>
<%- } -%>
<%- if $rails_allow_mod_rewrite { -%>
RailsAllowModRewrite <%= $rails_allow_mod_rewrite %>
<%- } -%>
<%- if $rails_app_spawner_idle_time { -%>
RailsAppSpawnerIdleTime <%= $rails_app_spawner_idle_time %>
<%- } -%>
<%- if $rails_auto_detect { -%>
RailsAutoDetect <%= $rails_auto_detect %>
<%- } -%>
<%- if $rails_base_uri { -%>
RailsBaseURI <%= $rails_base_uri %>
<%- } -%>
<%- if $rails_default_user { -%>
RailsDefaultUser <%= $rails_default_user %>
<%- } -%>
<%- if $rails_env { -%>
RailsEnv <%= $rails_env %>
<%- } -%>
<%- if $rails_framework_spawner_idle_time { -%>
RailsFrameworkSpawnerIdleTime <%= $rails_framework_spawner_idle_time %>
<%- } -%>
<%- if $rails_ruby { -%>
RailsRuby <%= $rails_ruby %>
<%- } -%>
<%- if $rails_spawn_method { -%>
RailsSpawnMethod <%= $rails_spawn_method %>
<%- } -%>
<%- if $rails_user_switching { -%>
RailsUserSwitching <%= $rails_user_switching %>
<%- } -%>
<%- if $wsgi_auto_detect { -%>
WsgiAutoDetect <%= $wsgi_auto_detect %>
<%- } -%>
<%- if $rails_autodetect { -%>
RailsAutoDetect <%= $rails_autodetect %>
<%- } -%>
Expand Down
16 changes: 2 additions & 14 deletions templates/vhost/_scriptalias.erb
@@ -1,14 +1,2 @@
<%- aliases = @scriptaliases -%>
## Script alias directives
<%# Combine scriptalias and scriptaliases into a single data structure -%>
<%# for backward compatibility and ease of implementation -%>
<%- aliases << { 'alias' => '/cgi-bin', 'path' => @scriptalias } if @scriptalias -%>
<%- aliases.each do |salias| -%>
<%- if salias["path"] != '' -%>
<%- if salias["alias"] and salias["alias"] != '' -%>
ScriptAlias <%= salias['alias'] %> "<%= salias['path'] %>"
<%- elsif salias["aliasmatch"] and salias["aliasmatch"] != '' -%>
ScriptAliasMatch <%= salias['aliasmatch'] %> "<%= salias['path'] %>"
<%- end -%>
<%- end -%>
<%- end -%>
## Script alias directives
ScriptAlias /cgi-bin "<%= @scriptalias %>"

0 comments on commit c2a7444

Please sign in to comment.