homelab/roles/openldap/tasks/main.yml

32 lines
779 B
YAML

- name: ensure directories exist
file:
path: "{{ item }}"
state: directory
mode: '0755'
loop:
- "{{ data_folder }}/openldap"
- "{{ data_folder }}/openldap/data"
- name: create network
docker_network:
name: openldap
attachable: true
internal: true
state: present
- name: run container
docker_container:
name: "openldap"
image: osixia/openldap
hostname: openldap
networks:
- name: openldap
ports:
- "389:389"
- "636:636"
volumes:
- "{{ data_folder }}/openldap/data:/var/lib/ldap"
env:
LDAP_ORGANISATION: "Homelab"
LDAP_DOMAIN: "kucharczyk.xyz"
LDAP_ADMIN_PASSWORD: "{{ vault_openldap_admin_password }}"
LDAP_REMOVE_CONFIG_AFTER_SETUP: "false"
state: started