Puppet Class: apache::mod::userdir

Defined in:
manifests/mod/userdir.pp

Summary

Installs and configures `mod_userdir`.

Overview

Parameters:

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

    Deprecated Path to system home directory.

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

    Deprecated Path from user’s home directory to public directory.

  • 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.

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

    Used to verify that the Apache version you have requested is compatible with the module.

  • 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:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'manifests/mod/userdir.pp', line 36

class apache::mod::userdir (
  Optional[String] $home            = undef,
  Optional[String] $dir             = undef,
  Optional[String[1]] $userdir      = undef,
  Boolean $disable_root             = true,
  Optional[String] $apache_version  = undef,
  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_version = pick($apache_version, $apache::apache_version)

  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': }

  # Template uses $home, $dir, $disable_root, $_apache_version
  file { 'userdir.conf':
    ensure  => file,
    path    => "${apache::mod_dir}/userdir.conf",
    mode    => $apache::file_mode,
    content => template('apache/mod/userdir.conf.erb'),
    require => Exec["mkdir ${apache::mod_dir}"],
    before  => File[$apache::mod_dir],
    notify  => Class['apache::service'],
  }
}