summaryrefslogtreecommitdiff
path: root/manifests/init.pp
blob: b8be630965a024c841a513ef95833f0088c66bef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# @summary Configures PHPLDAPAdmin
# @param servername
#   Pretty name for the server
# @param server_uri
#   Address of ldap server to connect to
# @param port
#   Port of ldap server to connect to
# @param debug_mode
# @param tmpdir
# @param timezone
# @param friendly_attrs
# @param auth_type
class phpldapadmin (
  String $servername = 'My LDAP Server',
  String $server_uri = '127.0.0.1',
  Integer[0, 65535] $port = 389,
  Boolean $debug_mode = false,
  String $tmpdir = '/tmp',
  Optional[String] $timezone = undef,
  Hash[String, String] $friendly_attrs = {
    'facsimileTelephoneNumber' => 'Fax',
    'gid'                      => 'Group',
    'mail'                     => 'Email',
    'telephoneNumber'          => 'Telephone',
    'uid'                      => 'User Name',
    'userPassword'             => 'Password',
  },
  Enum['cookie', 'session', 'http', 'config', 'sasl', 'sasl_external'] $auth_type = 'session',
) {
  ensure_packages(['phpldapadmin'])

  # /etc/php7/php.ini
  # extension=ldap
  # exteniosn

  # TODO also ensure writable by web server
  file { $tmpdir:
    ensure => directory,
  }

  file { '/etc/webapps/phpldapadmin/config.php':
    content => epp("${module_name}/config.php.epp"),
  }
}