diff --git a/manifests/mod/userdir.pp b/manifests/mod/userdir.pp index 68f927b207..7cdf4b32ef 100644 --- a/manifests/mod/userdir.pp +++ b/manifests/mod/userdir.pp @@ -1,11 +1,5 @@ # @summary # Installs and configures `mod_userdir`. -# -# @param home -# *Deprecated* Path to system home directory. -# -# @param dir -# *Deprecated* Path from user's home directory to public directory. # # @param userdir # Path or directory name to be used as the UserDir. @@ -31,8 +25,6 @@ # @see https://httpd.apache.org/docs/current/mod/mod_userdir.html for additional documentation. # class apache::mod::userdir ( - Optional[String] $home = undef, - Optional[String] $dir = undef, Optional[String[1]] $userdir = undef, Boolean $disable_root = true, String $path = '/home/*/public_html', @@ -43,36 +35,18 @@ ) { include apache - if $home or $dir { - $_home = $home ? { - undef => '/home', - default => $home, - } - $_dir = $dir ? { - undef => 'public_html', - default => $dir, - } - warning('home and dir are deprecated; use path instead') - $_path = "${_home}/*/${_dir}" - } else { - $_path = $path - } - - $_userdir = pick($userdir, $_path) - ::apache::mod { 'userdir': } $parameters = { 'disable_root' => $disable_root, - '_userdir' => $_userdir, + 'userdir' => pick($userdir, $path), 'unmanaged_path' => $unmanaged_path, - '_path' => $_path, + 'path' => $path, 'overrides' => $overrides, 'options' => $options, 'custom_fragment' => $custom_fragment, } - # Template uses $home, $dir, $disable_root file { 'userdir.conf': ensure => file, path => "${apache::mod_dir}/userdir.conf", diff --git a/spec/classes/mod/userdir_spec.rb b/spec/classes/mod/userdir_spec.rb index cad5269ad7..a12d5c02fb 100644 --- a/spec/classes/mod/userdir_spec.rb +++ b/spec/classes/mod/userdir_spec.rb @@ -17,28 +17,6 @@ it { is_expected.to compile } end - context 'with dir set to something' do - let :params do - { - dir: 'hi' - } - end - - it { is_expected.to contain_file('userdir.conf').with_content(%r{^\s*UserDir\s+/home/\*/hi$}) } - it { is_expected.to contain_file('userdir.conf').with_content(%r{^\s*$}) } - end - - context 'with home set to something' do - let :params do - { - home: '/u' - } - end - - it { is_expected.to contain_file('userdir.conf').with_content(%r{^\s*UserDir\s+/u/\*/public_html$}) } - it { is_expected.to contain_file('userdir.conf').with_content(%r{^\s*$}) } - end - context 'with path set to something' do let :params do { diff --git a/templates/mod/userdir.conf.epp b/templates/mod/userdir.conf.epp index 90996109ea..bd6bfce646 100644 --- a/templates/mod/userdir.conf.epp +++ b/templates/mod/userdir.conf.epp @@ -2,10 +2,10 @@ <% if $disable_root { -%> UserDir disabled root <% } -%> - UserDir <%= $_userdir %> + UserDir <%= $userdir %> <%- if !$unmanaged_path { -%> - "> + "> AllowOverride <%= $overrides.join(' ') %> Options <%= $options.join(' ') %>