Skip to content

Commit ad51d77

Browse files
committed
Progess on LDAP
1 parent 61028cc commit ad51d77

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

openldap/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ resource "nomad_job" "ldap" {
1616
admin_password = var.admin_password
1717
basedn = var.basedn
1818
organization = var.organization
19+
20+
# LDIF templates which are only applied when the data directory is empty (first run)
1921
ldif = jsonencode({
2022
"root" = file("${path.module}/ldif/root.ldif")
2123
})

openldap/nomad/openldap.hcl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ variable "organization" {
7979
// LOCALS
8080

8181
locals {
82-
data_path = "/bitnami/openldap/data"
82+
data_path = "/bitnami/openldap"
8383
ldif_path = "${NOMAD_ALLOC_DIR}/data/ldif"
8484
schema_path = "${NOMAD_ALLOC_DIR}/data/schema"
8585
}
@@ -115,7 +115,7 @@ job "openldap" {
115115
network {
116116
port "ldap" {
117117
static = var.port
118-
to = 389
118+
to = 1389
119119
}
120120
}
121121

@@ -167,15 +167,15 @@ job "openldap" {
167167
LDAP_ADD_SCHEMAS = "yes"
168168
LDAP_EXTRA_SCHEMAS = "cosine, inetorgperson, nis"
169169
LDAP_SKIP_DEFAULT_TREE = "yes"
170-
LDAP_CUSTOM_LDIF_DIR = "" // local.ldif_path
171-
LDAP_CUSTOM_SCHEMA_DIR = "" // local.schema_path
170+
LDAP_CUSTOM_LDIF_DIR = local.ldif_path
171+
LDAP_CUSTOM_SCHEMA_DIR = local.schema_path
172172
}
173173

174174
config {
175175
image = var.docker_image
176176
force_pull = var.docker_always_pull
177177
volumes = compact([
178-
format("%s:%s", var.data, local.data_path),
178+
format("%s:%s/data", var.data, local.data_path),
179179
])
180180
ports = ["ldap"]
181181
}

0 commit comments

Comments
 (0)