Skip to content

Remove deprecated scriptaliases parameter #2469

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

Closed
wants to merge 1 commit into from
Closed
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
37 changes: 1 addition & 36 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
10 changes: 0 additions & 10 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
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
14 changes: 1 addition & 13 deletions templates/vhost/_scriptalias.erb
Original file line number Diff line number Diff line change
@@ -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 -%>
ScriptAlias /cgi-bin "<%= @scriptalias %>"