In between commit refactoring LDAP, to continue working on other computer

This commit is contained in:
2025-04-08 11:23:16 +02:00
parent a43d1302ac
commit a13bd1883e
18 changed files with 183 additions and 176 deletions

View File

@@ -1,33 +0,0 @@
- name: "load lam variables"
include_vars:
file: lam.yml
- name: "Ensure LAM profiles directory exists"
file:
path: "{{ lam_profiles_dir }}"
state: directory
mode: '0755'
recurse: true
#- name: "create {{docker_compose.directories.env}}lam.env"
# template:
# src: "lam/env.j2"
# dest: "{{docker_compose.directories.env}}lam.env"
# mode: '770'
# force: yes
# notify: docker compose project setup
#
#- name: "create default.group to enable groupOfNames in LAM"
# template:
# src: "lam/default.group.j2"
# dest: "{{ lam_profiles_dir }}/default.group"
# mode: '0644'
# notify: docker compose project setup
#
#- name: "Create groupOfNames.conf to enable groupOfNames as base module in LAM"
# template:
# src: "lam/groupOfNames.conf.j2"
# dest: "{{ lam_profiles_dir }}/groupOfNames.conf"
# mode: '0644'

View File

@@ -3,13 +3,6 @@
include_role:
name: docker-compose
- name: "include role nginx-domain-setup for {{application_id}}"
include_role:
name: nginx-domain-setup
vars:
domain: "{{ domains[application_id] }}"
http_port: "{{ ports.localhost.http[application_id] }}"
- name: Create {{domains[application_id]}}.conf if LDAP is exposed to internet
template:
src: "nginx.stream.conf.j2"
@@ -29,20 +22,7 @@
state: present
ipam_config:
- subnet: "{{ networks.local.central_ldap.subnet }}"
- name: "create {{docker_compose.directories.env}}phpldapadmin.env"
template:
src: "phpldapadmin.env.j2"
dest: "{{docker_compose.directories.env}}phpldapadmin.env"
mode: '770'
force: yes
notify: docker compose project setup
when: applications.ldap.webinterface == 'phpldapadmin'
- name: "execute lam tasks"
include_tasks: lam.yml
when: applications.ldap.webinterface == 'lam'
- name: "copy docker-compose.yml and env file"
include_tasks: copy-docker-compose-and-env.yml

View File

@@ -2,32 +2,11 @@ services:
{% include 'roles/docker-oauth2-proxy/templates/container.yml.j2' %}
{{applications.ldap.webinterface}}:
container_name: {{applications.ldap.webinterface}}
logging:
driver: journald
restart: {{docker_restart_policy}}
{% if applications.ldap.webinterface == 'lam' %}
image: ghcr.io/ldapaccountmanager/lam:{{applications.ldap.lam.version}}
ports:
- 127.0.0.1:{{ports.localhost.http.ldap}}:80
env_file:
- "{{docker_compose.directories.env}}lam.env"
# volumes:
# - "{{ lam_profiles_dir }}:/var/lib/ldap-account-manager/config/profiles/"
{% elif applications.ldap.webinterface == 'phpldapadmin' %}
image: leenooks/phpldapadmin:{{applications.ldap.phpldapadmin.version}}
ports:
- 127.0.0.1:{{ports.localhost.http.ldap}}:8080
env_file:
- "{{docker_compose.directories.env}}phpldapadmin.env"
{% endif %}
openldap:
image: bitnami/openldap:{{applications.ldap.openldap.version}}
container_name: {{applications.ldap.openldap.hostname}}
application:
image: bitnami/openldap:{{ applications[application_id].version }}
container_name: {{ application_id }}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
{% if applications.ldap.openldap.network.public | bool %}
{% if applications[application_id].network.public | bool %}
ports:
- 127.0.0.1:{{ports.localhost.ldap.openldap}}:{{ldap_docker_port}} # Expose just on localhost so that nginx stream proxy can use it
{% endif %}

View File

@@ -1 +0,0 @@
Modules: groupOfNames

View File

@@ -1,13 +0,0 @@
# See all variables here: https://github.com/LDAPAccountManager/lam/blob/develop/lam-packaging/docker/.env
# Basic Configuration
LAM_PASSWORD= {{applications.ldap.lam.administrator_password}} # LAM configuration master password and password for server profile "lam
# Database
LAM_CONFIGURATION_DATABASE= files # configuration database (files or mysql) @todo implement mariadb
# LDAP Configuration
LDAP_SERVER= {{ldap.server.domain}} # domain of LDAP database root entry
LDAP_BASE_DN= {{ldap.dn.root}} # LDAP base DN to overwrite value generated by LDAP_DOMAIN
LDAP_USER= {{ldap.dn.administrator}} # LDAP admin user (set as login user for LAM)
LDAP_ADMIN_PASSWORD= {{ldap.bind_credential}} # LDAP admin password

View File

@@ -1,5 +0,0 @@
type: group
module: groupOfNames
cn: cn
description: description
member: member

View File

@@ -1,3 +0,0 @@
# @See https://github.com/leenooks/phpLDAPadmin/wiki/Docker-Container
APP_URL= https://{{domains[application_id]}}
LDAP_HOST= openldap

View File

@@ -1 +0,0 @@
lam_profiles_dir: "{{ docker_compose.directories.volumes }}lam/config/profiles/"