From a2adaa2101d2b82d457c1ef6e9e25acb9022b9fc Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 22 Dec 2020 14:52:49 +0100 Subject: [PATCH] Migrate directory to new Nomad syntax --- app/deployment/{bottin2.hcl => directory.hcl} | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) rename app/deployment/{bottin2.hcl => directory.hcl} (76%) diff --git a/app/deployment/bottin2.hcl b/app/deployment/directory.hcl similarity index 76% rename from app/deployment/bottin2.hcl rename to app/deployment/directory.hcl index fec7d74..0acc08f 100644 --- a/app/deployment/bottin2.hcl +++ b/app/deployment/directory.hcl @@ -1,4 +1,4 @@ -job "directory2" { +job "directory" { datacenters = ["dc1"] type = "service" priority = 90 @@ -10,15 +10,21 @@ job "directory2" { group "bottin" { count = 1 + + network { + port "ldap_port" { + static = 389 + to = 389 + } + } + task "bottin" { driver = "docker" config { image = "lxpz/bottin_amd64:20" network_mode = "host" readonly_rootfs = true - port_map { - ldap_port = 389 - } + ports = [ "ldap_port" ] volumes = [ "secrets/config.json:/config.json" ] @@ -26,15 +32,10 @@ job "directory2" { resources { memory = 100 - network { - port "ldap_port" { - static = "389" - } - } } template { - data = "{{ key \"configuration/directory/bottin/config.json\" }}" + data = file("../config/configuration/directory/bottin/config.json") destination = "secrets/config.json" } @@ -60,34 +61,29 @@ job "directory2" { group "guichet" { count = 1 + + network { + port "web_port" { to = 9991 } + } + task "guichet" { driver = "docker" config { image = "lxpz/guichet_amd64:10" readonly_rootfs = true - port_map { - web_port = 9991 - } + ports = [ "web_port" ] volumes = [ "secrets/config.json:/config.json" ] } - artifact { - source = "http://127.0.0.1:8500/v1/kv/configuration/directory/guichet/config.json.tpl?raw" - destination = "secrets/config.json.tpl" - mode = "file" - } template { - source = "secrets/config.json.tpl" + data = file("../config/configuration/directory/guichet/config.json.tpl") destination = "secrets/config.json" } resources { memory = 200 - network { - port "web_port" {} - } } service {