Skip to content

Commit b9547ef

Browse files
authored
Merge pull request #2292 from francetv/main
Allow setting icons_path to false so no alias will be set for it
2 parents 2603379 + 0f3c2d8 commit b9547ef

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

manifests/mod/alias.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
# @see https://httpd.apache.org/docs/current/mod/mod_alias.html for additional documentation.
2323
#
2424
class apache::mod::alias (
25-
Optional[String] $apache_version = undef,
26-
String $icons_options = 'Indexes MultiViews',
25+
Optional[String] $apache_version = undef,
26+
String $icons_options = 'Indexes MultiViews',
2727
# set icons_path to false to disable the alias
28-
Stdlib::Absolutepath $icons_path = $apache::params::alias_icons_path,
29-
String $icons_prefix = $apache::params::icons_prefix
28+
Variant[Boolean, Stdlib::Absolutepath] $icons_path = $apache::params::alias_icons_path,
29+
String $icons_prefix = $apache::params::icons_prefix
3030
) inherits apache::params {
3131
include apache
3232
$_apache_version = pick($apache_version, $apache::apache_version)

spec/classes/mod/alias_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@
6060
it { is_expected.to contain_apache__mod('alias') }
6161
it { is_expected.to contain_file('alias.conf').with(content: %r{Alias \/apache-icons\/ "\/usr\/share\/httpd\/icons\/"}) }
6262
end
63+
context 'with icons path as false', :compile do
64+
let :pre_condition do
65+
'class { apache: default_mods => false }'
66+
end
67+
let :params do
68+
{
69+
'icons_path' => false,
70+
}
71+
end
72+
73+
include_examples 'RedHat 7'
74+
75+
it { is_expected.to contain_apache__mod('alias') }
76+
it { is_expected.not_to contain_file('alias.conf') }
77+
end
6378
context 'on a FreeBSD OS', :compile do
6479
include_examples 'FreeBSD 10'
6580

0 commit comments

Comments
 (0)