From f551b44b4f17950ef1daf03c7691a7685ffe6eae Mon Sep 17 00:00:00 2001 From: Christian Elberfeld <christian.elberfeld@adesso.de> Date: Thu, 30 Jan 2020 02:51:33 +0100 Subject: [PATCH] LDAP Replikation --- .../docker_ldap/templates/docker-compose.yml | 39 +++++++++---------- site.yml | 4 +- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/common/docker_ldap/templates/docker-compose.yml b/common/docker_ldap/templates/docker-compose.yml index 59a50da1..41c68b15 100644 --- a/common/docker_ldap/templates/docker-compose.yml +++ b/common/docker_ldap/templates/docker-compose.yml @@ -7,8 +7,7 @@ services: image: osixia/openldap:1.3.0 restart: always command: --loglevel debug -# hostname: {{ inventory_hostname }}-sync - network_mode: host + hostname: {{ inventory_hostname }}-sync extra_hosts: - "webserver-sync{% if inventory_hostname == "webserver" %}-dummy{% endif %}:{{ hostvars['webserver'].int_ip4 }}" - "warpsrvint-sync{% if inventory_hostname == "warpsrvint" %}-dummy{% endif %}:{{ hostvars['warpsrvint'].int_ip4 }}" @@ -16,12 +15,11 @@ services: volumes: - /srv/ldap/database:/var/lib/ldap - /srv/ldap/config:/etc/ldap/slapd.d -# ports: -# - {{ int_ip4 }}:389:389 -# - {{ int_ip4 }}:636:636 + ports: + - {{ int_ip4 }}:389:389 + - {{ int_ip4 }}:636:636 environment: - - HOSTNAME={{ int_ip4 }} -# - HOSTNAME={{ inventory_hostname }}-sync + - HOSTNAME={{ inventory_hostname }}-sync - LDAP_BACKEND=hdb - LDAP_ORGANISATION={{ ldap_org }} - LDAP_DOMAIN={{ ldap_domain }} @@ -32,8 +30,8 @@ services: - LDAP_READONLY_USER_PASSWORD={{ ldap_readonly_pass }} - LDAP_TLS_VERIFY_CLIENT=never - LDAP_REPLICATION=false -# - LDAP_REPLICATION=true -# - LDAP_REPLICATION_HOSTS=#PYTHON2BASH:['ldap://webserver-sync','ldap://warpsrvint-sync','ldap://verwaltung-sync'] + - LDAP_REPLICATION=true + - LDAP_REPLICATION_HOSTS=#PYTHON2BASH:['ldap://webserver-sync','ldap://warpsrvint-sync','ldap://verwaltung-sync'] phpldapadmin: image: osixia/phpldapadmin:0.9.0 @@ -43,18 +41,17 @@ services: ports: - 127.0.0.1:42004:80 environment: - - PHPLDAPADMIN_LDAP_HOSTS={{ int_ip4 }} -# - PHPLDAPADMIN_LDAP_HOSTS=openldap + - PHPLDAPADMIN_LDAP_HOSTS=openldap - PHPLDAPADMIN_HTTPS=false - PHPLDAPADMIN_TRUST_PROXY_SSL=true -# syncreplexporter: -# build: . -# image: "syncreplexporter--{{ ansible_date_time.date }}--{{ ansible_date_time.hour }}-{{ ansible_date_time.minute }}-{{ ansible_date_time.second }}" -# restart: always -# depends_on: -# - openldap -# volumes: -# - /srv/ldap/syncrepl_exporter.yml:/syncrepl_exporter.yml -# ports: -# - {{ int_ip4 }}:9328:9328 + syncreplexporter: + build: . + image: "syncreplexporter--{{ ansible_date_time.date }}--{{ ansible_date_time.hour }}-{{ ansible_date_time.minute }}-{{ ansible_date_time.second }}" + restart: always + depends_on: + - openldap + volumes: + - /srv/ldap/syncrepl_exporter.yml:/syncrepl_exporter.yml + ports: + - {{ int_ip4 }}:9328:9328 diff --git a/site.yml b/site.yml index 8165d989..f589bb79 100644 --- a/site.yml +++ b/site.yml @@ -26,7 +26,7 @@ - { role: common/borgserver, tags: borgserver } - { role: common/docker, tags: docker } - { role: common/telegraf, tags: telegraf } -# - { role: common/docker_ldap, tags: ldap } + - { role: common/docker_ldap, tags: ldap } - { role: common/nginx, tags: nginx } - { role: warpsrvint/docker_grafana, tags: grafana } - { role: warpsrvint/docker_influx, tags: influx } @@ -80,7 +80,7 @@ - { role: common/docker, tags: docker } - { role: common/nginx, tags: nginx } - { role: common/openvpn, tags: openvpn } -# - { role: common/docker_ldap, tags: ldap } + - { role: common/docker_ldap, tags: ldap } - { role: verwaltung/docker_gitea, tags: gitea } - { role: verwaltung/docker_nextcloud, tags: nextcloud } - { role: verwaltung/docker_mysql, tags: mysql } -- GitLab