Skip to content

Commit 6830c7f

Browse files
authored
Merge pull request #2465 from ekohl/clean-up-userdir
Remove deprecated parameters from mod::userdir
2 parents 4291314 + ecb84e6 commit 6830c7f

File tree

3 files changed

+4
-52
lines changed

3 files changed

+4
-52
lines changed

manifests/mod/userdir.pp

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# @summary
22
# Installs and configures `mod_userdir`.
3-
#
4-
# @param home
5-
# *Deprecated* Path to system home directory.
6-
#
7-
# @param dir
8-
# *Deprecated* Path from user's home directory to public directory.
93
#
104
# @param userdir
115
# Path or directory name to be used as the UserDir.
@@ -31,8 +25,6 @@
3125
# @see https://httpd.apache.org/docs/current/mod/mod_userdir.html for additional documentation.
3226
#
3327
class apache::mod::userdir (
34-
Optional[String] $home = undef,
35-
Optional[String] $dir = undef,
3628
Optional[String[1]] $userdir = undef,
3729
Boolean $disable_root = true,
3830
String $path = '/home/*/public_html',
@@ -43,36 +35,18 @@
4335
) {
4436
include apache
4537

46-
if $home or $dir {
47-
$_home = $home ? {
48-
undef => '/home',
49-
default => $home,
50-
}
51-
$_dir = $dir ? {
52-
undef => 'public_html',
53-
default => $dir,
54-
}
55-
warning('home and dir are deprecated; use path instead')
56-
$_path = "${_home}/*/${_dir}"
57-
} else {
58-
$_path = $path
59-
}
60-
61-
$_userdir = pick($userdir, $_path)
62-
6338
::apache::mod { 'userdir': }
6439

6540
$parameters = {
6641
'disable_root' => $disable_root,
67-
'_userdir' => $_userdir,
42+
'userdir' => pick($userdir, $path),
6843
'unmanaged_path' => $unmanaged_path,
69-
'_path' => $_path,
44+
'path' => $path,
7045
'overrides' => $overrides,
7146
'options' => $options,
7247
'custom_fragment' => $custom_fragment,
7348
}
7449

75-
# Template uses $home, $dir, $disable_root
7650
file { 'userdir.conf':
7751
ensure => file,
7852
path => "${apache::mod_dir}/userdir.conf",

spec/classes/mod/userdir_spec.rb

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,6 @@
1717
it { is_expected.to compile }
1818
end
1919

20-
context 'with dir set to something' do
21-
let :params do
22-
{
23-
dir: 'hi'
24-
}
25-
end
26-
27-
it { is_expected.to contain_file('userdir.conf').with_content(%r{^\s*UserDir\s+/home/\*/hi$}) }
28-
it { is_expected.to contain_file('userdir.conf').with_content(%r{^\s*<Directory\s+"/home/\*/hi">$}) }
29-
end
30-
31-
context 'with home set to something' do
32-
let :params do
33-
{
34-
home: '/u'
35-
}
36-
end
37-
38-
it { is_expected.to contain_file('userdir.conf').with_content(%r{^\s*UserDir\s+/u/\*/public_html$}) }
39-
it { is_expected.to contain_file('userdir.conf').with_content(%r{^\s*<Directory\s+"/u/\*/public_html">$}) }
40-
end
41-
4220
context 'with path set to something' do
4321
let :params do
4422
{

templates/mod/userdir.conf.epp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<% if $disable_root { -%>
33
UserDir disabled root
44
<% } -%>
5-
UserDir <%= $_userdir %>
5+
UserDir <%= $userdir %>
66

77
<%- if !$unmanaged_path { -%>
8-
<Directory "<%= $_path %>">
8+
<Directory "<%= $path %>">
99
AllowOverride <%= $overrides.join(' ') %>
1010
Options <%= $options.join(' ') %>
1111
<Limit GET POST OPTIONS>

0 commit comments

Comments
 (0)