2025-01-21 16:50:43 +01:00
|
|
|
---
|
2025-01-29 14:20:34 +01:00
|
|
|
- name: "include docker-compose role"
|
|
|
|
include_role:
|
|
|
|
name: docker-compose
|
2025-01-21 16:50:43 +01:00
|
|
|
|
2025-02-19 02:00:41 +01:00
|
|
|
- name: "include role nginx-domain-setup for {{application_id}}"
|
2025-02-21 05:46:42 +01:00
|
|
|
include_role:
|
2025-02-19 02:00:41 +01:00
|
|
|
name: nginx-domain-setup
|
2025-02-21 05:46:42 +01:00
|
|
|
vars:
|
|
|
|
domain: "{{ domains[application_id] }}"
|
|
|
|
http_port: "{{ ports.localhost.http[application_id] }}"
|
2025-01-21 16:50:43 +01:00
|
|
|
|
2025-01-29 14:20:34 +01:00
|
|
|
- name: Create {{domain}}.conf if LDAP is exposed to internet
|
2025-01-21 23:33:24 +01:00
|
|
|
template:
|
|
|
|
src: "nginx.stream.conf.j2"
|
2025-01-31 13:14:07 +01:00
|
|
|
dest: "{{nginx.directories.streams}}{{domain}}.conf"
|
2025-01-21 23:33:24 +01:00
|
|
|
notify: restart nginx
|
2025-02-12 12:41:13 +01:00
|
|
|
when: applications.ldap.openldap.network.public | bool
|
2025-01-29 14:20:34 +01:00
|
|
|
|
|
|
|
- name: Remove {{domain}}.conf if LDAP is not exposed to internet
|
|
|
|
file:
|
2025-01-31 13:14:07 +01:00
|
|
|
path: "{{ nginx.directories.streams }}{{ domain }}.conf"
|
2025-01-29 14:20:34 +01:00
|
|
|
state: absent
|
2025-02-12 12:41:13 +01:00
|
|
|
when: not applications.ldap.openldap.network.public | bool
|
2025-01-21 23:33:24 +01:00
|
|
|
|
2025-02-06 17:15:33 +01:00
|
|
|
- name: create docker network for LDAP, so that other applications can access it
|
|
|
|
docker_network:
|
|
|
|
name: central_ldap
|
|
|
|
state: present
|
2025-02-20 15:09:36 +01:00
|
|
|
ipam_config:
|
|
|
|
- subnet: "{{ networks.local.central_ldap.subnet }}"
|
2025-02-06 17:15:33 +01:00
|
|
|
|
2025-02-04 22:37:07 +01:00
|
|
|
- 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
|
2025-02-06 16:27:00 +01:00
|
|
|
when: applications.ldap.webinterface == 'phpldapadmin'
|
2025-01-21 16:50:43 +01:00
|
|
|
|
2025-02-04 22:37:07 +01:00
|
|
|
- name: "create {{docker_compose.directories.env}}lam.env"
|
2025-01-21 16:50:43 +01:00
|
|
|
template:
|
2025-02-04 22:37:07 +01:00
|
|
|
src: "lam.env.j2"
|
|
|
|
dest: "{{docker_compose.directories.env}}lam.env"
|
|
|
|
mode: '770'
|
|
|
|
force: yes
|
2025-02-06 16:27:00 +01:00
|
|
|
notify: docker compose project setup
|
2025-02-11 16:19:08 +01:00
|
|
|
when: applications.ldap.webinterface == 'lam'
|
|
|
|
|
2025-02-21 03:53:27 +01:00
|
|
|
- name: "copy docker-compose.yml and env file"
|
|
|
|
include_tasks: copy-docker-compose-and-env.yml
|
2025-02-11 16:19:08 +01:00
|
|
|
|
2025-02-21 00:26:33 +01:00
|
|
|
- name: "create directory {{ldif_host_path}}{{item}}"
|
2025-02-11 18:09:26 +01:00
|
|
|
file:
|
2025-02-21 00:26:33 +01:00
|
|
|
path: "{{ldif_host_path}}{{item}}"
|
2025-02-11 18:09:26 +01:00
|
|
|
state: directory
|
|
|
|
mode: 0755
|
2025-02-21 00:26:33 +01:00
|
|
|
loop: "{{ldif_types}}"
|
2025-02-11 18:09:26 +01:00
|
|
|
|
2025-02-21 00:26:33 +01:00
|
|
|
- name: "Process all LDIF types"
|
|
|
|
include_tasks: create_ldif_files.yml
|
|
|
|
loop: "{{ ldif_types }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: folder
|
2025-02-20 22:16:02 +01:00
|
|
|
|
|
|
|
- name: Force LDIF files import
|
|
|
|
command: /bin/true
|
|
|
|
notify: Import LDIF files
|
|
|
|
when: applications.ldap.force_import | bool
|