openstack-helm-infra/ldap/templates/bin/_bootstrap.sh.tpl
Pete Birley c24c7e42f3 Ldap: Drive scheme via endpoints section
This PS updates the ldap scheme used to be driven by the endpoints
section.

Change-Id: I87e12d12f9d0806174a94b5b6dacb6360f4e2410
2018-05-19 05:32:05 +00:00

9 lines
508 B
Smarty

#!/bin/bash
set -xe
{{- $url := tuple "ldap" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
{{- $port := tuple "ldap" "internal" "ldap" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
LDAPHOST="{{ .Values.endpoints.ldap.scheme }}://{{ $url }}:{{ $port }}"
ADMIN="cn={{ .Values.secrets.identity.admin }},{{ tuple .Values.openldap.domain . | include "splitdomain" }}"
ldapadd -x -D $ADMIN -H $LDAPHOST -w {{ .Values.openldap.password }} -f /etc/sample_data.ldif