summaryrefslogtreecommitdiff
path: root/manifests/phpldapadmin.pp
blob: 8e2b5d58e1ba630a8b0da0f80840fa63b8fae89e (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
45
46
# @summary Sets up a phpldapadmin instance
# @option nginx_server
#   Name of the nginx server
# @option Manage server
#   Should this class manage the nginx server resource
class profiles::phpldapadmin (
  String $nginx_server,
  Boolean $manage_server = true,
) {

  include ::php_fpm

  nginx::resource::server { $nginx_server:
    ipv6_enable         => true,
    ipv6_listen_options => '',
    www_root            => '/usr/share/webapps/phpldapadmin',
    index_files         => ['index.php'],
  }

  class { 'phpldapadmin':
    servername => 'Adrift.Space LDAP',
    auth_type  => 'cookie',
  }

  php_fpm::nginx { 'phpldapadmin':
    server => $nginx_server,
    conf   => {
      location_allow => [
        '127.0.0.1',
        '::1',
        "${facts['network6']}/${extlib::netmask_to_cidr($facts['netmask6'])}",
        "${facts['network']}/${extlib::netmask_to_cidr($facts['netmask'])}",
      ],
      location_deny  => [
        'all',
      ],
      www_root       => '/usr/share/webapps/phpldapadmin',
    },
  }

  # nginx::resource::location { 'phpldapadmin':
  #   ssl            => true,
  #   ssl_only       => true,
  # }

}