feat: add basic ds389 docker setup and configuration
Signed-off-by: Bert-Jan Fikse <bert-jan@whatwedo.ch>
This commit is contained in:
parent
dae32362ed
commit
700cafed0e
3 changed files with 70 additions and 0 deletions
|
|
@ -1,3 +1,26 @@
|
||||||
#SPDX-License-Identifier: MIT-0
|
#SPDX-License-Identifier: MIT-0
|
||||||
---
|
---
|
||||||
# defaults file for 389ds
|
# defaults file for 389ds
|
||||||
|
|
||||||
|
# Base directory configuration (inherited from base role or defined here)
|
||||||
|
docker_compose_base_dir: /etc/docker/compose
|
||||||
|
docker_volume_base_dir: /srv/data
|
||||||
|
|
||||||
|
# 389ds-specific configuration
|
||||||
|
ds389_service_name: 389ds
|
||||||
|
ds389_docker_compose_dir: "{{ docker_compose_base_dir }}/{{ ds389_service_name }}"
|
||||||
|
ds389_docker_volume_dir: "{{ docker_volume_base_dir }}/{{ ds389_service_name }}"
|
||||||
|
|
||||||
|
# 389ds service configuration
|
||||||
|
ds389_image: "docker.io/389ds/dirsrv:3.1"
|
||||||
|
ds389_suffix: "dc=example,dc=com"
|
||||||
|
ds389_root_dn: "cn=Directory Manager"
|
||||||
|
ds389_root_password: "changeme"
|
||||||
|
|
||||||
|
# Instance configuration
|
||||||
|
ds389_instance_name: "localhost"
|
||||||
|
|
||||||
|
# Network configuration
|
||||||
|
ds389_backend_network: "backend"
|
||||||
|
ds389_ldap_port: 3389
|
||||||
|
ds389_ldaps_port: 3636
|
||||||
|
|
@ -1,3 +1,32 @@
|
||||||
#SPDX-License-Identifier: MIT-0
|
#SPDX-License-Identifier: MIT-0
|
||||||
---
|
---
|
||||||
# tasks file for 389ds
|
# tasks file for 389ds
|
||||||
|
|
||||||
|
- name: Create docker compose directory
|
||||||
|
file:
|
||||||
|
path: "{{ ds389_docker_compose_dir }}"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Create 389ds data directory
|
||||||
|
file:
|
||||||
|
path: "{{ ds389_docker_volume_dir }}/data"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Create 389ds config directory
|
||||||
|
file:
|
||||||
|
path: "{{ ds389_docker_volume_dir }}/config"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Create docker-compose file for 389ds
|
||||||
|
template:
|
||||||
|
src: docker-compose.yml.j2
|
||||||
|
dest: "{{ ds389_docker_compose_dir }}/docker-compose.yml"
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
- name: Start 389ds container
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ ds389_docker_compose_dir }}"
|
||||||
|
state: present
|
||||||
18
roles/389ds/templates/docker-compose.yml.j2
Normal file
18
roles/389ds/templates/docker-compose.yml.j2
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
services:
|
||||||
|
{{ ds389_service_name }}:
|
||||||
|
image: {{ ds389_image }}
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
DS_SUFFIX_NAME: {{ ds389_suffix }}
|
||||||
|
DS_DM_PASSWORD: {{ ds389_root_password }}
|
||||||
|
ports:
|
||||||
|
- "{{ ds389_ldap_port }}:3389"
|
||||||
|
- "{{ ds389_ldaps_port }}:3636"
|
||||||
|
volumes:
|
||||||
|
- {{ ds389_docker_volume_dir }}/data:/data
|
||||||
|
- {{ ds389_docker_volume_dir }}/config:/etc/dirsrv/slapd-{{ ds389_instance_name }}
|
||||||
|
networks:
|
||||||
|
- {{ ds389_backend_network }}
|
||||||
|
|
||||||
|
networks:
|
||||||
|
{{ ds389_backend_network }}:
|
||||||
Loading…
Add table
Add a link
Reference in a new issue