Puppet Class: apache::mod::userdir

Defined in:
manifests/mod/userdir.pp

Summary

Installs and configures `mod_userdir`.

Overview

Parameters:

  • userdir (Optional[String[1]]) (defaults to: undef)

    Path or directory name to be used as the UserDir.

  • disable_root (Boolean) (defaults to: true)

    Toggles whether to allow use of root directory.

  • path (String) (defaults to: '/home/*/public_html')

    Path to directory or pattern from which to find user-specific directories.

  • overrides (Array[String]) (defaults to: ['FileInfo', 'AuthConfig', 'Limit', 'Indexes'])

    Array of directives that are allowed in .htaccess files.

  • options (Array[String]) (defaults to: ['MultiViews', 'Indexes', 'SymLinksIfOwnerMatch', 'IncludesNoExec'])

    Configures what features are available in a particular directory.

  • unmanaged_path (Boolean) (defaults to: false)

    Toggles whether to manage path in userdir.conf

  • custom_fragment (Optional[String]) (defaults to: undef)

    Custom configuration to be added to userdir.conf

See Also:



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'manifests/mod/userdir.pp', line 27

class apache::mod::userdir (
  Optional[String[1]] $userdir      = undef,
  Boolean $disable_root             = true,
  String $path                      = '/home/*/public_html',
  Array[String] $overrides          = ['FileInfo', 'AuthConfig', 'Limit', 'Indexes'],
  Array[String] $options            = ['MultiViews', 'Indexes', 'SymLinksIfOwnerMatch', 'IncludesNoExec'],
  Boolean $unmanaged_path           = false,
  Optional[String] $custom_fragment = undef,
) {
  include apache

  ::apache::mod { 'userdir': }

  $parameters = {
    'disable_root'    => $disable_root,
    'userdir'         => pick($userdir, $path),
    'unmanaged_path'  => $unmanaged_path,
    'path'            => $path,
    'overrides'       => $overrides,
    'options'         => $options,
    'custom_fragment' => $custom_fragment,
  }

  file { 'userdir.conf':
    ensure  => file,
    path    => "${apache::mod_dir}/userdir.conf",
    mode    => $apache::file_mode,
    content => epp('apache/mod/userdir.conf.epp', $parameters),
    require => Exec["mkdir ${apache::mod_dir}"],
    before  => File[$apache::mod_dir],
    notify  => Class['apache::service'],
  }
}