summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-06-13 15:43:18 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-06-13 15:43:18 +0200
commit25e2692b23288cea718d1c1e66d76ef114b5afd8 (patch)
tree654c940c3ea81fce8bdf900a42bb1c75ddf920b0
parentAdd concourse profile. (diff)
downloadprofiles-25e2692b23288cea718d1c1e66d76ef114b5afd8.tar.gz
profiles-25e2692b23288cea718d1c1e66d76ef114b5afd8.tar.xz
Fix php ldap admin.
-rw-r--r--manifests/phpldapadmin.pp73
1 files changed, 33 insertions, 40 deletions
diff --git a/manifests/phpldapadmin.pp b/manifests/phpldapadmin.pp
index 55bfa33..3794178 100644
--- a/manifests/phpldapadmin.pp
+++ b/manifests/phpldapadmin.pp
@@ -1,52 +1,45 @@
+# @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,
) {
- # TODO
- # include ::profiles::phpfpm
+ include ::php_fpm
- class { 'phpldapadmin':
- auth_type => 'cookie',
+ nginx::resoruce::server { $nginx_server:
+ ipv6_enable => true,
+ ipv6_listen_options => '',
+ use_default_location => false,
}
- # TODO do this better.
- # Debian gives this file through nginx-common, but I can't find it
- # for arch.
- file { '/etc/nginx/snippets/fastcgi-php.conf':
- content => @(EOF)
- # regex to split $uri to $fastcgi_script_name and $fastcgi_path
- fastcgi_split_path_info ^(.+?\.php)(/.*)$;
-
- # Check that the PHP script exists before passing it
- try_files $fastcgi_script_name =404;
-
- # Bypass the fact that try_files resets $fastcgi_path_info
- # see: http://trac.nginx.org/nginx/ticket/321
- set $path_info $fastcgi_path_info;
- fastcgi_param PATH_INFO $path_info;
-
- fastcgi_index index.php;
- include fastcgi.conf;
- | EOF
+ class { 'phpldapadmin':
+ servername => 'Adrift.Space LDAP',
+ auth_type => 'cookie',
}
- nginx::resource::location { 'phpldapadmin':
- location => '~ \.php$',
- server => $nginx_server,
- fastcgi_params => 'snippets/fastcgi-php.conf',
- fastcgi => 'unix:/run/php-fpm7/php-fpm.sock',
- ssl => true,
- ssl_only => true,
- www_root => '/usr/share/webapps/phpldapadmin',
- 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',
- ],
+ php_fpm::nginx { 'phpldapadmin':
+ server => $nginx_server,
+ conf => {
+ www_root => '/usr/share/webapps/phpldapadmin',
+ 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',
+ ],
+ },
}
+ # nginx::resource::location { 'phpldapadmin':
+ # ssl => true,
+ # ssl_only => true,
+ # }
+
}