From f9fe0c513ef1e12cb322cc825649ba2b3698bd8f Mon Sep 17 00:00:00 2001 From: Bruce Becker Date: Sat, 25 May 2024 06:16:41 +0200 Subject: [PATCH] fix(bdii): use template to provision bdii configuration Signed-off-by: Bruce Becker --- bdii/bdii.hcl | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/bdii/bdii.hcl b/bdii/bdii.hcl index 55e53fb..b0a9371 100644 --- a/bdii/bdii.hcl +++ b/bdii/bdii.hcl @@ -96,7 +96,7 @@ job "bdii" { network { port "slapd" { - static = 2170 + to = 2170 } } service { @@ -131,8 +131,9 @@ job "bdii" { # The "driver" parameter specifies the task driver that should be used to # run the task. artifact { - source = "https://github.com/EGI-Federation/glue-schema//etc/ldap/schema" + source = "github.com/EGI-Federation/glue-schema.git//etc/ldap/schema" destination = "local/schema" + mode = "dir" } artifact { @@ -145,16 +146,22 @@ job "bdii" { artifact { # slapd config EGI-Foundation/bdii source = "https://raw.githubusercontent.com/EGI-Foundation/bdii/v${var.bdii.version}/etc/bdii-slapd.conf" - destination = "local/etc/bdii-slapd.conf" + destination = "/local/etc/bdii-slapd.conf" mode = "file" } template { data = file("provision_config_files.sh.tmpl") - destination = "/docker-entrypoint-initdb.d/provision_config_files.sh" + destination = "/docker-entrypoint-initdb.d/start.sh" perms = "777" } + template { + data = file("bdii-slapd.conf") + destination = "local/bdii-slapd.conf" + perms = "0644" + } + driver = "docker" config { image = "bitnami/openldap:2.6" @@ -163,14 +170,17 @@ job "bdii" { } env { LDAP_PORT_NUMBER = "${NOMAD_PORT_slapd}" - // LDAP_EXTRA_SCHEMAS = "inetorgperson,nis,cosine" + // LDAP_CUSTOM_SCHEMA_FILE = "Glue-CORE" LDAP_ADD_SCHEMAS = "yes" + // LDAP_EXTRA_SCHEMAS = "Glue-CORE" LDAP_LOGLEVEL = 2048 LDAP_ENABLE_ACCESSLOG = "yes" LDAP_ACCESSLOG_LOGOPS = "all" BDII_VAR_DIR = "${var.slapd.bdii_var_dir}" SLAPD_DB_DIR = "${var.slapd.db_dir}" - LDAP_CUSTOM_SCHEMA_DIR = "/local/schema" + // LDAP_CUSTOM_SCHEMA_DIR = "/local/schema/" + // BITNAMI_DEBUG = true + LDAP_SKIP_DEFAULT_TREE = "yes" } logs { max_files = 10 @@ -182,8 +192,8 @@ job "bdii" { file = true } resources { - cpu = 125 # 500 MHz - memory = 256 # 512MB + cpu = 500 # 500 MHz + memory = 512 # 512MB } volume_mount {