mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-02-23 04:49:40 +01:00
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
---
|
|
- name: "include docker-compose role"
|
|
include_role:
|
|
name: docker-compose
|
|
|
|
- name: "include role nginx-domain-setup for {{application_id}}"
|
|
include_role:
|
|
name: nginx-domain-setup
|
|
|
|
- name: Create {{domain}}.conf if LDAP is exposed to internet
|
|
template:
|
|
src: "nginx.stream.conf.j2"
|
|
dest: "{{nginx.directories.streams}}{{domain}}.conf"
|
|
notify: restart nginx
|
|
when: applications.ldap.openldap.network.public | bool
|
|
|
|
- name: Remove {{domain}}.conf if LDAP is not exposed to internet
|
|
file:
|
|
path: "{{ nginx.directories.streams }}{{ domain }}.conf"
|
|
state: absent
|
|
when: not applications.ldap.openldap.network.public | bool
|
|
|
|
- name: create docker network for LDAP, so that other applications can access it
|
|
docker_network:
|
|
name: central_ldap
|
|
state: present
|
|
ipam_config:
|
|
- subnet: "{{ networks.local.central_ldap.subnet }}"
|
|
|
|
- name: "copy docker-compose.yml and env file"
|
|
include_tasks: copy-docker-compose-and-env.yml
|
|
|
|
- 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: "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
|
|
when: applications.ldap.webinterface == 'lam'
|
|
|
|
- name: flush docker service
|
|
meta: flush_handlers
|
|
|
|
- name: "create directory {{ldif_host_path}}"
|
|
file:
|
|
path: "{{ldif_host_path}}"
|
|
state: directory
|
|
mode: 0755
|
|
|
|
- name: "Create LDIF files at {{ ldif_host_path }}"
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: "{{ ldif_host_path }}/{{ item | basename | regex_replace('\\.j2$', '') }}"
|
|
mode: '770'
|
|
loop: "{{ lookup('fileglob', '{{ role_path }}/templates/ldif/*.j2', wantlist=True) }}"
|
|
notify: Import LDIF files
|
|
|
|
- name: Force LDIF files import
|
|
command: /bin/true
|
|
notify: Import LDIF files
|
|
when: applications.ldap.force_import | bool |