diff --git a/roles/docker/defaults/main.yml b/roles/docker/defaults/main.yml index 75e3683..3d0368d 100644 --- a/roles/docker/defaults/main.yml +++ b/roles/docker/defaults/main.yml @@ -3,6 +3,7 @@ nginx: ldap: domain: "ldap.{{ base_domain }}" + volume_folder: "{{ volume_root_folder }}/openldap" thelounge: domain: "irc.{{ base_domain }}" diff --git a/roles/docker/tasks/services/openldap.yml b/roles/docker/tasks/services/openldap.yml index dcdfef5..463ac0b 100644 --- a/roles/docker/tasks/services/openldap.yml +++ b/roles/docker/tasks/services/openldap.yml @@ -1,4 +1,14 @@ --- +- name: create ldap volume folders + file: + name: "{{ ldap.volume_folder }}/{{ volume }}" + state: directory + loop: + - "var/lib/ldap" + - "etc/slapd" + - "certs" + loop_control: + loop_var: volume - name: Create a network for ldap docker_network: @@ -11,9 +21,9 @@ tty: true interactive: true volumes: - - /var/lib/ldap - - /etc/ldap/slapd.d - - /container/service/slapd/assets/certs/ + - "{{ ldap.volume_folder }}/var/lib/ldap:/var/lib/ldap" + - "{{ ldap.volume_folder }}/etc/slapd.d:/etc/ldap/slapd.d" + - "{{ ldap.volume_folder }}/certs:/container/service/slapd/assets/certs/" published_ports: - "389:389" - "636:636"