From f0698dddcd041027e25fc2e26507f9672ce9584c Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <ynerant@crans.org>
Date: Thu, 13 May 2021 01:36:39 +0200
Subject: [PATCH] [re2o-ldap-replica] Add some comments

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
---
 roles/re2o-ldap-replica/tasks/main.yml                     | 7 +++++++
 roles/re2o-ldap-replica/templates/ldap/certinfo.ldif.j2    | 2 ++
 .../templates/ldap/consumer_simple_sync.ldif.j2            | 2 ++
 roles/re2o-ldap-replica/templates/ldap/db.ldif.j2          | 5 +++++
 roles/re2o-ldap-replica/templates/ldap/schema.ldif.j2      | 5 +++++
 5 files changed, 21 insertions(+)

diff --git a/roles/re2o-ldap-replica/tasks/main.yml b/roles/re2o-ldap-replica/tasks/main.yml
index 18afef0d..558df2fa 100644
--- a/roles/re2o-ldap-replica/tasks/main.yml
+++ b/roles/re2o-ldap-replica/tasks/main.yml
@@ -11,6 +11,12 @@
   retries: 3
   until: apt_result is succeeded
 
+# Since we can't apply same updates to the LDAP server,
+# we create at the end of the deployment a file which
+# indicates that the replica is installed.
+# If this file is still present, then we don't redeploy
+# the reploy. If it was deleted or missing, then we
+# rebuild the replica.
 - name: Check if installation was done
   stat:
     path: /var/lib/slapd/.delete_me_to_reset_ldap_configuration
@@ -75,6 +81,7 @@
   when: not installation.stat.exists
   shell: ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /var/lib/slapd/consumer_simple_sync.ldif
 
+# LDAPS configuration
 - name: Copy TLS certificate
   template:
     src: "ldap/{{ item }}.j2"
diff --git a/roles/re2o-ldap-replica/templates/ldap/certinfo.ldif.j2 b/roles/re2o-ldap-replica/templates/ldap/certinfo.ldif.j2
index 9e1d6b51..8571016c 100644
--- a/roles/re2o-ldap-replica/templates/ldap/certinfo.ldif.j2
+++ b/roles/re2o-ldap-replica/templates/ldap/certinfo.ldif.j2
@@ -1,3 +1,5 @@
+{{ ansible_header | comment }}
+
 dn: cn=config
 add: olcTLSCertificateFile
 olcTLSCertificateFile: /etc/ldap/ldap.pem
diff --git a/roles/re2o-ldap-replica/templates/ldap/consumer_simple_sync.ldif.j2 b/roles/re2o-ldap-replica/templates/ldap/consumer_simple_sync.ldif.j2
index 31d82149..f15a81df 100644
--- a/roles/re2o-ldap-replica/templates/ldap/consumer_simple_sync.ldif.j2
+++ b/roles/re2o-ldap-replica/templates/ldap/consumer_simple_sync.ldif.j2
@@ -1,3 +1,5 @@
+{{ ansible_header | comment }}
+
 dn: olcDatabase={1}hdb,cn=config
 changetype: modify
 add: olcSyncrepl
diff --git a/roles/re2o-ldap-replica/templates/ldap/db.ldif.j2 b/roles/re2o-ldap-replica/templates/ldap/db.ldif.j2
index dd6f37d5..ca2f992f 100644
--- a/roles/re2o-ldap-replica/templates/ldap/db.ldif.j2
+++ b/roles/re2o-ldap-replica/templates/ldap/db.ldif.j2
@@ -1,3 +1,8 @@
+{{ ansible_header | comment }}
+
+# This file comes from the installation of Re2o
+# https://gitlab.federez.net/re2o/re2o/-/blob/master/install_utils/db.ldiff
+
 dn: {{ re2o_ldap_replica.suffix }}
 o: rezo
 structuralObjectClass: organization
diff --git a/roles/re2o-ldap-replica/templates/ldap/schema.ldif.j2 b/roles/re2o-ldap-replica/templates/ldap/schema.ldif.j2
index 2e3ed41e..564a2380 100644
--- a/roles/re2o-ldap-replica/templates/ldap/schema.ldif.j2
+++ b/roles/re2o-ldap-replica/templates/ldap/schema.ldif.j2
@@ -1,3 +1,8 @@
+{{ ansible_header | comment }}
+
+# This file comes from the installation of Re2o
+# https://gitlab.federez.net/re2o/re2o/-/blob/master/install_utils/schema.ldiff
+
 dn: cn=config
 objectClass: olcGlobal
 cn: config
-- 
GitLab