2021-12-25 18:40:51 +00:00
|
|
|
job "core" {
|
2022-08-24 17:54:15 +00:00
|
|
|
datacenters = ["orion", "neptune"]
|
2021-12-25 18:40:51 +00:00
|
|
|
type = "system"
|
|
|
|
priority = 90
|
|
|
|
|
|
|
|
update {
|
2022-08-24 19:06:48 +00:00
|
|
|
max_parallel = 1
|
2021-12-25 18:40:51 +00:00
|
|
|
stagger = "1m"
|
|
|
|
}
|
|
|
|
|
|
|
|
group "network" {
|
|
|
|
task "diplonat" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
2022-08-24 16:19:04 +00:00
|
|
|
image = "lxpz/amd64_diplonat:4"
|
2021-12-25 18:40:51 +00:00
|
|
|
network_mode = "host"
|
|
|
|
readonly_rootfs = true
|
2022-08-24 17:54:15 +00:00
|
|
|
privileged = true
|
2021-12-30 19:56:13 +00:00
|
|
|
volumes = [
|
|
|
|
"secrets:/etc/diplonat",
|
|
|
|
]
|
2021-12-25 18:40:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
restart {
|
|
|
|
interval = "30m"
|
|
|
|
attempts = 2
|
|
|
|
delay = "15s"
|
|
|
|
mode = "delay"
|
|
|
|
}
|
|
|
|
|
2021-12-30 19:56:13 +00:00
|
|
|
template {
|
2022-08-24 15:31:08 +00:00
|
|
|
data = "{{ key \"secrets/consul/consul.crt\" }}"
|
|
|
|
destination = "secrets/consul.crt"
|
2021-12-30 19:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.crt\" }}"
|
|
|
|
destination = "secrets/consul-client.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.key\" }}"
|
|
|
|
destination = "secrets/consul-client.key"
|
|
|
|
}
|
|
|
|
|
2021-12-25 18:40:51 +00:00
|
|
|
template {
|
|
|
|
data = <<EOH
|
|
|
|
DIPLONAT_REFRESH_TIME=60
|
|
|
|
DIPLONAT_EXPIRATION_TIME=300
|
|
|
|
DIPLONAT_CONSUL_NODE_NAME={{ env "attr.unique.hostname" }}
|
2022-08-24 15:31:08 +00:00
|
|
|
DIPLONAT_CONSUL_URL=https://consul.service.prod.consul:8501
|
2022-08-24 16:19:04 +00:00
|
|
|
DIPLONAT_CONSUL_TLS_SKIP_VERIFY=true
|
2021-12-30 19:56:13 +00:00
|
|
|
DIPLONAT_CONSUL_CLIENT_CERT=/etc/diplonat/consul-client.crt
|
|
|
|
DIPLONAT_CONSUL_CLIENT_KEY=/etc/diplonat/consul-client.key
|
2021-12-25 18:40:51 +00:00
|
|
|
RUST_LOG=debug
|
|
|
|
EOH
|
|
|
|
destination = "secrets/env"
|
|
|
|
env = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
memory = 40
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-24 19:06:48 +00:00
|
|
|
|
|
|
|
group "tricot" {
|
|
|
|
constraint {
|
|
|
|
distinct_property = "${meta.site}"
|
|
|
|
value = "1"
|
|
|
|
}
|
|
|
|
|
|
|
|
network {
|
|
|
|
port "http_port" { static = 80 }
|
|
|
|
port "https_port" { static = 443 }
|
|
|
|
}
|
|
|
|
|
|
|
|
task "server" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "lxpz/amd64_tricot:42"
|
|
|
|
network_mode = "host"
|
|
|
|
readonly_rootfs = true
|
|
|
|
ports = [ "http_port", "https_port" ]
|
|
|
|
volumes = [
|
|
|
|
"secrets:/etc/tricot",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
2022-10-16 09:04:36 +00:00
|
|
|
cpu = 500
|
2022-08-24 19:06:48 +00:00
|
|
|
memory = 200
|
|
|
|
}
|
|
|
|
|
|
|
|
restart {
|
|
|
|
interval = "30m"
|
|
|
|
attempts = 2
|
|
|
|
delay = "15s"
|
|
|
|
mode = "delay"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-ca.crt\" }}"
|
|
|
|
destination = "secrets/consul-ca.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.crt\" }}"
|
|
|
|
destination = "secrets/consul-client.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.key\" }}"
|
|
|
|
destination = "secrets/consul-client.key"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOH
|
|
|
|
TRICOT_NODE_NAME={{ env "attr.unique.consul.name" }}
|
2022-10-09 20:57:55 +00:00
|
|
|
TRICOT_LETSENCRYPT_EMAIL=prod-sysadmin@deuxfleurs.fr
|
2022-08-24 19:06:48 +00:00
|
|
|
TRICOT_ENABLE_COMPRESSION=true
|
|
|
|
TRICOT_CONSUL_HOST=https://consul.service.prod.consul:8501
|
|
|
|
TRICOT_CONSUL_TLS_SKIP_VERIFY=true
|
|
|
|
TRICOT_CONSUL_CLIENT_CERT=/etc/tricot/consul-client.crt
|
|
|
|
TRICOT_CONSUL_CLIENT_KEY=/etc/tricot/consul-client.key
|
|
|
|
TRICOT_HTTP_BIND_ADDR=[::]:80
|
|
|
|
TRICOT_HTTPS_BIND_ADDR=[::]:443
|
|
|
|
RUST_LOG=tricot=debug
|
|
|
|
EOH
|
|
|
|
destination = "secrets/env"
|
|
|
|
env = true
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "tricot-http"
|
|
|
|
port = "http_port"
|
|
|
|
tags = [ "(diplonat (tcp_port 80))", "${meta.site}" ]
|
|
|
|
address_mode = "host"
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "tricot-https"
|
|
|
|
port = "https_port"
|
|
|
|
tags = [ "(diplonat (tcp_port 443))", "${meta.site}" ]
|
|
|
|
address_mode = "host"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
group "bottin" {
|
|
|
|
constraint {
|
|
|
|
distinct_property = "${meta.site}"
|
|
|
|
value = "1"
|
|
|
|
}
|
|
|
|
|
|
|
|
network {
|
|
|
|
port "ldap_port" {
|
|
|
|
static = 389
|
|
|
|
to = 389
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task "bottin" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
|
|
|
image = "superboum/bottin_amd64:22"
|
|
|
|
network_mode = "host"
|
|
|
|
readonly_rootfs = true
|
|
|
|
ports = [ "ldap_port" ]
|
|
|
|
volumes = [
|
|
|
|
"secrets/config.json:/config.json",
|
|
|
|
"secrets:/etc/bottin",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
memory = 100
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = file("../config/bottin/config.json.tpl")
|
|
|
|
destination = "secrets/config.json"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul.crt\" }}"
|
|
|
|
destination = "secrets/consul.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.crt\" }}"
|
|
|
|
destination = "secrets/consul-client.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.key\" }}"
|
|
|
|
destination = "secrets/consul-client.key"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOH
|
|
|
|
CONSUL_HTTP_ADDR=https://consul.service.prod.consul:8501
|
|
|
|
CONSUL_HTTP_SSL=true
|
|
|
|
CONSUL_CACERT=/etc/bottin/consul.crt
|
|
|
|
CONSUL_CLIENT_CERT=/etc/bottin/consul-client.crt
|
|
|
|
CONSUL_CLIENT_KEY=/etc/bottin/consul-client.key
|
|
|
|
EOH
|
|
|
|
destination = "secrets/env"
|
|
|
|
env = true
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
tags = [ "${meta.site}" ]
|
|
|
|
port = "ldap_port"
|
|
|
|
address_mode = "host"
|
|
|
|
name = "bottin"
|
|
|
|
check {
|
|
|
|
type = "tcp"
|
|
|
|
port = "ldap_port"
|
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-12-25 18:40:51 +00:00
|
|
|
}
|