|
1 | 1 | # @summary
|
2 | 2 | # 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. |
9 | 3 | #
|
10 | 4 | # @param userdir
|
11 | 5 | # Path or directory name to be used as the UserDir.
|
|
31 | 25 | # @see https://httpd.apache.org/docs/current/mod/mod_userdir.html for additional documentation.
|
32 | 26 | #
|
33 | 27 | class apache::mod::userdir (
|
34 |
| - Optional[String] $home = undef, |
35 |
| - Optional[String] $dir = undef, |
36 | 28 | Optional[String[1]] $userdir = undef,
|
37 | 29 | Boolean $disable_root = true,
|
38 | 30 | String $path = '/home/*/public_html',
|
|
43 | 35 | ) {
|
44 | 36 | include apache
|
45 | 37 |
|
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 |
| - |
63 | 38 | ::apache::mod { 'userdir': }
|
64 | 39 |
|
65 | 40 | $parameters = {
|
66 | 41 | 'disable_root' => $disable_root,
|
67 |
| - '_userdir' => $_userdir, |
| 42 | + 'userdir' => pick($userdir, $path), |
68 | 43 | 'unmanaged_path' => $unmanaged_path,
|
69 |
| - '_path' => $_path, |
| 44 | + 'path' => $path, |
70 | 45 | 'overrides' => $overrides,
|
71 | 46 | 'options' => $options,
|
72 | 47 | 'custom_fragment' => $custom_fragment,
|
73 | 48 | }
|
74 | 49 |
|
75 |
| - # Template uses $home, $dir, $disable_root |
76 | 50 | file { 'userdir.conf':
|
77 | 51 | ensure => file,
|
78 | 52 | path => "${apache::mod_dir}/userdir.conf",
|
|
0 commit comments