diff --git a/charts/dbildungs-iam-ldap/templates/configmap-config-script.yaml b/charts/dbildungs-iam-ldap/templates/configmap-config-script.yaml index 91ba121..5b079ff 100644 --- a/charts/dbildungs-iam-ldap/templates/configmap-config-script.yaml +++ b/charts/dbildungs-iam-ldap/templates/configmap-config-script.yaml @@ -23,17 +23,18 @@ data: sleep 10 # Loading Schemas - if ! (ldapsearch -Y EXTERNAL -H ldapi:/// -b "cn=schema,cn=config" "(cn=*ucsMail)"); then - ldapadd -Y EXTERNAL -H ldapi:/// -f /opt/bitnami/openldap/etc/schema/ucsmail.ldif + ucsmail_search_output=$(ldapsearch -Y EXTERNAL -H ldapi:/// -b "cn=schema,cn=config" "(cn=*ucsMail)") + if (echo "$ucsmail_search_output" | grep -q "numEntries: 1"); then + echo "Entry for ucsMail Schema already exists. If you need to modify it, delete it and readd it." else - echo "Entry for ucsMail Schema already exists. Nothing to add." + ldapadd -Y EXTERNAL -H ldapi:/// -f /opt/bitnami/openldap/etc/schema/ucsmail.ldif fi - # Adding Config Users + # Adding Config Users from Secret /bin/bash /script/02.sh /ldap-configuration/apply/apply.ldif true - # Adding other Configs - # /bin/bash /script/02.sh /ldap-configuration/extra/apply.ldif false - # /bin/bash /script/02.sh /ldap-configuration/extra/modify.ldif true + # Adding other Configs from Configmap + /bin/bash /script/02.sh /ldap-configuration/extra/apply.ldif false + /bin/bash /script/02.sh /ldap-configuration/extra/modify.ldif true diff --git a/charts/dbildungs-iam-ldap/templates/configmap-extraldif.yaml b/charts/dbildungs-iam-ldap/templates/configmap-extraldif.yaml index ed96b70..9a76e8e 100644 --- a/charts/dbildungs-iam-ldap/templates/configmap-extraldif.yaml +++ b/charts/dbildungs-iam-ldap/templates/configmap-extraldif.yaml @@ -16,11 +16,13 @@ data: cn: lehrer objectclass: groupOfUniqueNames objectclass: top + uniquemember: dn: cn=schueler,dc=schule-sh,dc=de cn: schueler objectclass: groupOfUniqueNames objectclass: top + uniquemember: dn: ou=oeffentlicheSchulen,dc=schule-sh,dc=de objectclass: organizationalUnit @@ -55,7 +57,6 @@ data: cn: lehrer objectclass: groupOfUniqueNames objectclass: top - dn: cn=lehrer,dc=schule-sh,dc=de uniquemember: cn=ssuperadmin,ou=oeffentlicheSchulen,dc=schule-sh,dc=de dn: cn=schueler,dc=schule-sh,dc=de diff --git a/charts/dbildungs-iam-ldap/values.yaml b/charts/dbildungs-iam-ldap/values.yaml index 21cde16..aa07c7c 100644 --- a/charts/dbildungs-iam-ldap/values.yaml +++ b/charts/dbildungs-iam-ldap/values.yaml @@ -140,6 +140,7 @@ replication: persistence: enabled: true + # enabled: false # existingClaim: openldap-pvc accessModes: - ReadWriteOnce