aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-01 22:49:55 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-01 22:49:55 +0100
commite67b460ae20d7e026dd14d690d3bacd33639bc7b (patch)
treec51fcf1888a39ad2e119d52fcd70c03c3d971865
parentbc88622ea29b01e480ea6920fcbbb7279d2e25ec (diff)
downloadnixcfg-e67b460ae20d7e026dd14d690d3bacd33639bc7b.tar.gz
nixcfg-e67b460ae20d7e026dd14d690d3bacd33639bc7b.zip
staging: run bottin as nix job
-rw-r--r--cluster/staging/app/directory/deploy/directory.hcl23
1 files changed, 9 insertions, 14 deletions
diff --git a/cluster/staging/app/directory/deploy/directory.hcl b/cluster/staging/app/directory/deploy/directory.hcl
index 405c321..68e00d6 100644
--- a/cluster/staging/app/directory/deploy/directory.hcl
+++ b/cluster/staging/app/directory/deploy/directory.hcl
@@ -14,22 +14,18 @@ job "directory" {
network {
port "ldap_port" {
static = 389
- to = 389
}
}
task "bottin" {
- driver = "docker"
+ driver = "nix2"
config {
- image = "superboum/bottin_amd64:22"
- network_mode = "host"
- readonly_rootfs = true
- ports = [ "ldap_port" ]
- volumes = [
- "secrets/config.json:/config.json",
- "secrets:/etc/bottin",
+ packages = [
+ "git+https://git.deuxfleurs.fr/Deuxfleurs/bottin.git?ref=main&rev=9cab98d2cee386ece54b000bbdf2346da8b55eed"
]
+ command = "bottin"
}
+ user = "root" # needed to bind port 389
resources {
memory = 100
@@ -37,22 +33,22 @@ job "directory" {
template {
data = file("../config/bottin/config.json.tpl")
- destination = "secrets/config.json"
+ destination = "config.json"
}
template {
data = "{{ key \"secrets/consul/consul-ca.crt\" }}"
- destination = "secrets/consul-ca.crt"
+ destination = "etc/bottin/consul-ca.crt"
}
template {
data = "{{ key \"secrets/consul/consul-client.crt\" }}"
- destination = "secrets/consul-client.crt"
+ destination = "etc/bottin/consul-client.crt"
}
template {
data = "{{ key \"secrets/consul/consul-client.key\" }}"
- destination = "secrets/consul-client.key"
+ destination = "etc/bottin/consul-client.key"
}
template {
@@ -70,7 +66,6 @@ EOH
service {
tags = ["bottin"]
port = "ldap_port"
- address_mode = "host"
name = "bottin"
check {
type = "tcp"