Skip to content

Commit

Permalink
fix(bdii): use template to provision bdii configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Bruce Becker <brucellino@protonmail.ch>
  • Loading branch information
brucellino committed May 25, 2024
1 parent 07974e9 commit f9fe0c5
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions bdii/bdii.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ job "bdii" {

network {
port "slapd" {
static = 2170
to = 2170
}
}
service {
Expand Down Expand Up @@ -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 {
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit f9fe0c5

Please sign in to comment.