Skip to content

Commit 304ea95

Browse files
committed
(CAT-1449) - Cleanup for deprecated content from module
1 parent d1a79ed commit 304ea95

File tree

9 files changed

+189
-663
lines changed

9 files changed

+189
-663
lines changed

REFERENCE.md

Lines changed: 67 additions & 177 deletions
Large diffs are not rendered by default.

manifests/init.pp

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@
105105
# ```
106106
# **Note**: SSL virtual hosts only respond to HTTPS queries.
107107
#
108-
# @param default_type
109-
# _Apache 2.2 only_. Sets the MIME `content-type` sent if the server cannot otherwise
110-
# determine an appropriate `content-type`. This directive is deprecated in Apache 2.4 and
111-
# newer, and is only for backwards compatibility in configuration files.
112-
#
113108
# @param default_vhost
114109
# Configures a default virtual host when the class is declared.<br />
115110
# To configure customized virtual hosts, set this parameter's
@@ -423,10 +418,6 @@
423418
#
424419
# @param ip
425420
# Specifies the ip address
426-
#
427-
# @param purge_vdir
428-
# Removes all other Apache configs and virtual hosts.<br />
429-
# > **Note**: This parameter is deprecated in favor of the `purge_configs` parameter.<br />
430421
#
431422
# @param conf_enabled
432423
# Whether the additional config files in `/etc/apache2/conf-enabled` should be managed.
@@ -472,7 +463,6 @@
472463
Optional[Stdlib::Absolutepath] $default_ssl_crl = undef,
473464
Optional[String] $default_ssl_crl_check = undef,
474465
Boolean $default_ssl_reload_on_change = false,
475-
String $default_type = 'none',
476466
Optional[Variant[Array, String]] $dev_packages = $apache::params::dev_packages,
477467
Optional[String] $ip = undef,
478468
Boolean $service_enable = true,
@@ -481,7 +471,6 @@
481471
Optional[String] $service_restart = undef,
482472
Boolean $purge_configs = true,
483473
Optional[Boolean] $purge_vhost_dir = undef,
484-
Boolean $purge_vdir = false,
485474
Optional[String[1]] $serveradmin = undef,
486475
Apache::OnOff $sendfile = 'On',
487476
Optional[Apache::OnOff] $ldap_verify_server_cert = undef,
@@ -599,17 +588,9 @@
599588
service_restart => $service_restart,
600589
}
601590

602-
# Deprecated backwards-compatibility
603-
if $purge_vdir {
604-
warning('Class[\'apache\'] parameter purge_vdir is deprecated in favor of purge_configs')
605-
$purge_confd = $purge_vdir
606-
} else {
607-
$purge_confd = $purge_configs
608-
}
609-
610591
# Set purge vhostd appropriately
611592
if $purge_vhost_dir == undef {
612-
$purge_vhostd = $purge_confd
593+
$purge_vhostd = $purge_configs
613594
} else {
614595
$purge_vhostd = $purge_vhost_dir
615596
}
@@ -627,8 +608,8 @@
627608
file { $confd_dir:
628609
ensure => directory,
629610
recurse => true,
630-
purge => $purge_confd,
631-
force => $purge_confd,
611+
purge => $purge_configs,
612+
force => $purge_configs,
632613
notify => Class['Apache::Service'],
633614
require => Package['httpd'],
634615
}
@@ -637,8 +618,8 @@
637618
file { $conf_enabled:
638619
ensure => directory,
639620
recurse => true,
640-
purge => $purge_confd,
641-
force => $purge_confd,
621+
purge => $purge_configs,
622+
force => $purge_configs,
642623
notify => Class['Apache::Service'],
643624
require => Package['httpd'],
644625
}

manifests/mod/passenger.pp

Lines changed: 70 additions & 319 deletions
Large diffs are not rendered by default.

manifests/vhost.pp

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@
9696
# the `aliases` parameter. As described in the `mod_alias` documentation, add more specific
9797
# `alias`, `aliasmatch`, `scriptalias` or `scriptaliasmatch` parameters before the more
9898
# general ones to avoid shadowing.<BR />
99-
# > **Note**: Use the `aliases` parameter instead of the `scriptaliases` parameter because
100-
# you can precisely control the order of various alias directives. Defining `ScriptAliases`
101-
# using the `scriptaliases` parameter means *all* `ScriptAlias` directives will come after
102-
# *all* `Alias` directives, which can lead to `Alias` directives shadowing `ScriptAlias`
103-
# directives. This often causes problems; for example, this could cause problems with Nagios.<BR />
10499
# If `apache::mod::passenger` is loaded and `PassengerHighPerformance` is `true`, the `Alias`
105100
# directive might not be able to honor the `PassengerEnabled => off` statement. See
106101
# [this article](http://www.conandalton.net/2010/06/passengerenabled-off-not-working.html) for details.
@@ -1095,34 +1090,6 @@
10951090
# Defines a directory of CGI scripts to be aliased to the path '/cgi-bin', such as
10961091
# '/usr/scripts'.
10971092
#
1098-
# @param scriptaliases
1099-
# > **Note**: This parameter is deprecated in favor of the `aliases` parameter.<br />
1100-
# Passes an array of hashes to the virtual host to create either ScriptAlias or
1101-
# ScriptAliasMatch statements per the `mod_alias` documentation.
1102-
# ``` puppet
1103-
# scriptaliases => [
1104-
# {
1105-
# alias => '/myscript',
1106-
# path => '/usr/share/myscript',
1107-
# },
1108-
# {
1109-
# aliasmatch => '^/foo(.*)',
1110-
# path => '/usr/share/fooscripts$1',
1111-
# },
1112-
# {
1113-
# aliasmatch => '^/bar/(.*)',
1114-
# path => '/usr/share/bar/wrapper.sh/$1',
1115-
# },
1116-
# {
1117-
# alias => '/neatscript',
1118-
# path => '/usr/share/neatscript',
1119-
# },
1120-
# ]
1121-
# ```
1122-
# The ScriptAlias and ScriptAliasMatch directives are created in the order specified.
1123-
# As with [Alias and AliasMatch](#aliases) directives, specify more specific aliases
1124-
# before more general ones to avoid shadowing.
1125-
#
11261093
# @param serveradmin
11271094
# Specifies the email address Apache displays when it renders one of its error pages.
11281095
#
@@ -1811,7 +1778,6 @@
18111778
Variant[Array[Hash], String] $error_documents = [],
18121779
Optional[Variant[Stdlib::Absolutepath, Enum['disabled']]] $fallbackresource = undef,
18131780
Optional[String] $scriptalias = undef,
1814-
Array[Hash] $scriptaliases = [],
18151781
Optional[Integer] $limitreqfieldsize = undef,
18161782
Optional[Integer] $limitreqfields = undef,
18171783
Optional[Integer] $limitreqline = undef,
@@ -2552,9 +2518,8 @@
25522518
}
25532519

25542520
# Template uses:
2555-
# - $scriptaliases
25562521
# - $scriptalias
2557-
if ($scriptalias or !empty($scriptaliases)) and $ensure == 'present' {
2522+
if $scriptalias and $ensure == 'present' {
25582523
include apache::mod::alias
25592524

25602525
concat::fragment { "${name}-scriptalias":

spec/acceptance/vhost_spec.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -816,10 +816,6 @@ class { 'apache': }
816816
docroot => '/tmp',
817817
proxy_dest => 'http://testproxy',
818818
}
819-
apache::vhost { 'test.scriptaliases':
820-
docroot => '/tmp',
821-
scriptaliases => [{ alias => '/myscript', path => '/usr/share/myscript', }],
822-
}
823819
apache::vhost { 'test.aliases':
824820
docroot => '/tmp',
825821
aliases => [
@@ -930,11 +926,6 @@ class { 'apache': }
930926
it { is_expected.to contain 'ProxyPass / http://testproxy/' }
931927
end
932928

933-
describe file("#{apache_hash['vhost_dir']}/25-test.scriptaliases.conf") do
934-
it { is_expected.to be_file }
935-
it { is_expected.to contain 'ScriptAlias /myscript "/usr/share/myscript"' }
936-
end
937-
938929
describe file("#{apache_hash['vhost_dir']}/25-test.aliases.conf") do
939930
it { is_expected.to be_file }
940931
it { is_expected.to contain 'Alias /image "/ftp/pub/image"' }

spec/classes/mod/passenger_spec.rb

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@
2727
passenger_config_options = {
2828
'passenger_allow_encoded_slashes' => { type: 'OnOff', pass_opt: :PassengerAllowEncodedSlashes },
2929
'passenger_anonymous_telemetry_proxy' => { type: 'String', pass_opt: :PassengerAnonymousTelemetryProxy },
30+
'passenger_admin_panel_url' => { type: 'String', pass_opt: :PassengerAdminPanelUrl },
31+
'passenger_admin_panel_auth_type' => { type: ['basic'], pass_opt: :PassengerAdminPanelAuthType },
32+
'passenger_admin_panel_username' => { type: 'String', pass_opt: :PassengerAdminPanelUsername },
33+
'passenger_admin_panel_password' => { type: 'String', pass_opt: :PassengerAdminPanelPassword },
3034
'passenger_app_env' => { type: 'String', pass_opt: :PassengerAppEnv },
3135
'passenger_app_group_name' => { type: 'String', pass_opt: :PassengerAppGroupName },
36+
'passenger_app_log_file' => { type: 'String', pass_opt: :PassengerAppLogFile },
3237
'passenger_app_root' => { type: 'FullPath', pass_opt: :PassengerAppRoot },
3338
'passenger_app_type' => { type: 'String', pass_opt: :PassengerAppType },
3439
'passenger_base_uri' => { type: 'URI', pass_opt: :PassengerBaseURI },
@@ -44,6 +49,7 @@
4449
'passenger_disable_anonymous_telemetry' => { type: 'Boolean', pass_opt: :PassengerDisableAnonymousTelemetry },
4550
'passenger_disable_log_prefix' => { type: 'Boolean', pass_opt: :PassengerDisableLogPrefix },
4651
'passenger_disable_security_update_check' => { type: 'OnOff', pass_opt: :PassengerDisableSecurityUpdateCheck },
52+
'passenger_dump_config_manifest' => { type: 'String', pass_opt: :PassengerDumpConfigManifest },
4753
'passenger_enabled' => { type: 'OnOff', pass_opt: :PassengerEnabled },
4854
'passenger_error_override' => { type: 'OnOff', pass_opt: :PassengerErrorOverride },
4955
'passenger_file_descriptor_log_file' => { type: 'FullPath', pass_opt: :PassengerFileDescriptorLogFile },
@@ -63,6 +69,7 @@
6369
'passenger_max_pool_size' => { type: 'Integer', pass_opt: :PassengerMaxPoolSize },
6470
'passenger_max_preloader_idle_time' => { type: 'Integer', pass_opt: :PassengerMaxPreloaderIdleTime },
6571
'passenger_max_request_queue_size' => { type: 'Integer', pass_opt: :PassengerMaxRequestQueueSize },
72+
'passenger_max_request_queue_time' => { type: 'Integer', pass_opt: :PassengerMaxRequestQueueTime },
6673
'passenger_max_request_time' => { type: 'Integer', pass_opt: :PassengerMaxRequestTime },
6774
'passenger_max_requests' => { type: 'Integer', pass_opt: :PassengerMaxRequests },
6875
'passenger_memory_limit' => { type: 'Integer', pass_opt: :PassengerMemoryLimit },
@@ -94,22 +101,9 @@
94101
'passenger_use_global_queue' => { type: 'String', pass_opt: :PassengerUseGlobalQueue },
95102
'passenger_user' => { type: 'String', pass_opt: :PassengerUser },
96103
'passenger_user_switching' => { type: 'OnOff', pass_opt: :PassengerUserSwitching },
97-
'rack_auto_detect' => { type: 'String', pass_opt: :RackAutoDetect },
98-
'rack_autodetect' => { type: 'String', pass_opt: :RackAutoDetect },
99-
'rack_base_uri' => { type: 'String', pass_opt: :RackBaseURI },
100104
'rack_env' => { type: 'String', pass_opt: :RackEnv },
101-
'rails_allow_mod_rewrite' => { type: 'String', pass_opt: :RailsAllowModRewrite },
102-
'rails_app_spawner_idle_time' => { type: 'String', pass_opt: :RailsAppSpawnerIdleTime },
103-
'rails_auto_detect' => { type: 'String', pass_opt: :RailsAutoDetect },
104-
'rails_autodetect' => { type: 'String', pass_opt: :RailsAutoDetect },
105-
'rails_base_uri' => { type: 'String', pass_opt: :RailsBaseURI },
106-
'rails_default_user' => { type: 'String', pass_opt: :RailsDefaultUser },
107105
'rails_env' => { type: 'String', pass_opt: :RailsEnv },
108-
'rails_framework_spawner_idle_time' => { type: 'String', pass_opt: :RailsFrameworkSpawnerIdleTime },
109-
'rails_ruby' => { type: 'String', pass_opt: :RailsRuby },
110-
'rails_spawn_method' => { type: 'String', pass_opt: :RailsSpawnMethod },
111-
'rails_user_switching' => { type: 'String', pass_opt: :RailsUserSwitching },
112-
'wsgi_auto_detect' => { type: 'String', pass_opt: :WsgiAutoDetect }
106+
'rails_framework_spawner_idle_time' => { type: 'String', pass_opt: :RailsFrameworkSpawnerIdleTime }
113107
}
114108
passenger_config_options.each do |config_option, config_hash|
115109
puppetized_config_option = config_option
@@ -230,8 +224,8 @@
230224
describe 'fails when an option is removed' do
231225
let :params do
232226
{
233-
passenger_installed_version: '5.0.0',
234-
rails_autodetect: 'on'
227+
passenger_installed_version: '5.3.0',
228+
passenger_resist_deployment_errors: 'on'
235229
}
236230
end
237231

@@ -241,8 +235,8 @@
241235
describe 'warns when an option is deprecated' do
242236
let :params do
243237
{
244-
passenger_installed_version: '5.0.0',
245-
rails_ruby: '/some/path/to/ruby'
238+
passenger_installed_version: '5.1.0',
239+
passenger_debug_log_file: '/some/path/to/log'
246240
}
247241
end
248242

@@ -346,22 +340,6 @@
346340
it { is_expected.to contain_file('passenger.conf').with_content(%r{^ PassengerMaxInstancesPerApp 8$}) }
347341
end
348342

349-
describe 'with rack_autodetect => on' do
350-
let :params do
351-
{ rack_autodetect: 'on' }
352-
end
353-
354-
it { is_expected.to contain_file('passenger.conf').with_content(%r{^ RackAutoDetect on$}) }
355-
end
356-
357-
describe 'with rails_autodetect => on' do
358-
let :params do
359-
{ rails_autodetect: 'on' }
360-
end
361-
362-
it { is_expected.to contain_file('passenger.conf').with_content(%r{^ RailsAutoDetect on$}) }
363-
end
364-
365343
describe 'with passenger_use_global_queue => on' do
366344
let :params do
367345
{ passenger_use_global_queue: 'on' }
@@ -431,6 +409,17 @@
431409
it { is_expected.to contain_file('passenger.conf').without_content(%r{PassengerRuby}) }
432410
it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerDefaultRuby "/usr/bin/ruby"}) }
433411
end
412+
413+
describe "with passenger_admin_panel_url => 'https://example.com'" do
414+
let :params do
415+
{
416+
passenger_installed_version: '5.2.2',
417+
passenger_admin_panel_url: 'https://example.com'
418+
}
419+
end
420+
421+
it { is_expected.to contain_file('passenger.conf').with_content(%r{^ PassengerAdminPanelUrl https://example.com$}) }
422+
end
434423
when 'RedHat'
435424
context 'on a RedHat OS' do
436425
case facts[:os]['release']['major']

spec/defines/vhost_spec.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -324,16 +324,6 @@
324324
'error_documents' => 'true',
325325
'fallbackresource' => '/index.php',
326326
'scriptalias' => '/usr/lib/cgi-bin',
327-
'scriptaliases' => [
328-
{
329-
'alias' => '/myscript',
330-
'path' => '/usr/share/myscript'
331-
},
332-
{
333-
'aliasmatch' => '^/foo(.*)',
334-
'path' => '/usr/share/fooscripts$1'
335-
},
336-
],
337327
'limitreqfieldsize' => 8190,
338328
'limitreqfields' => 100,
339329
'limitreqline' => 8190,

0 commit comments

Comments
 (0)