Migrate directory to new Nomad syntax

This commit is contained in:
Quentin 2020-12-22 14:52:49 +01:00
parent bb5a82b056
commit a2adaa2101

View file

@ -1,4 +1,4 @@
job "directory2" { job "directory" {
datacenters = ["dc1"] datacenters = ["dc1"]
type = "service" type = "service"
priority = 90 priority = 90
@ -10,15 +10,21 @@ job "directory2" {
group "bottin" { group "bottin" {
count = 1 count = 1
network {
port "ldap_port" {
static = 389
to = 389
}
}
task "bottin" { task "bottin" {
driver = "docker" driver = "docker"
config { config {
image = "lxpz/bottin_amd64:20" image = "lxpz/bottin_amd64:20"
network_mode = "host" network_mode = "host"
readonly_rootfs = true readonly_rootfs = true
port_map { ports = [ "ldap_port" ]
ldap_port = 389
}
volumes = [ volumes = [
"secrets/config.json:/config.json" "secrets/config.json:/config.json"
] ]
@ -26,15 +32,10 @@ job "directory2" {
resources { resources {
memory = 100 memory = 100
network {
port "ldap_port" {
static = "389"
}
}
} }
template { template {
data = "{{ key \"configuration/directory/bottin/config.json\" }}" data = file("../config/configuration/directory/bottin/config.json")
destination = "secrets/config.json" destination = "secrets/config.json"
} }
@ -60,34 +61,29 @@ job "directory2" {
group "guichet" { group "guichet" {
count = 1 count = 1
network {
port "web_port" { to = 9991 }
}
task "guichet" { task "guichet" {
driver = "docker" driver = "docker"
config { config {
image = "lxpz/guichet_amd64:10" image = "lxpz/guichet_amd64:10"
readonly_rootfs = true readonly_rootfs = true
port_map { ports = [ "web_port" ]
web_port = 9991
}
volumes = [ volumes = [
"secrets/config.json:/config.json" "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 { template {
source = "secrets/config.json.tpl" data = file("../config/configuration/directory/guichet/config.json.tpl")
destination = "secrets/config.json" destination = "secrets/config.json"
} }
resources { resources {
memory = 200 memory = 200
network {
port "web_port" {}
}
} }
service { service {