mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-28 02:56:13 +01:00
1b51d5ae56
Signed-off-by: main <magic_rb@redalder.org>
59 lines
966 B
HCL
59 lines
966 B
HCL
variable "flake_ref" {
|
|
type = string
|
|
}
|
|
|
|
variable "flake_sha" {
|
|
type = string
|
|
}
|
|
|
|
job "camptules" {
|
|
datacenters = [ "homelab-1" ]
|
|
type = "service"
|
|
|
|
group "camptules" {
|
|
count = 1
|
|
|
|
network {
|
|
mode = "bridge"
|
|
}
|
|
|
|
task "camptules" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
nix_flake_ref = "${var.flake_ref}#nixngSystems.camptules.config.system.build.toplevel"
|
|
nix_flake_sha = var.flake_sha
|
|
entrypoint = [ "init" ]
|
|
}
|
|
|
|
resources {
|
|
cpu = 512
|
|
memory = 128
|
|
memory_max = 192
|
|
}
|
|
|
|
vault {
|
|
policies = ["camptules-policy"]
|
|
}
|
|
|
|
template {
|
|
data = <<EOF
|
|
{{ with secret "kv/data/camptules" }}
|
|
{{ .Data.data.token }}
|
|
{{ end }}
|
|
EOF
|
|
destination = "secrets/cfg"
|
|
}
|
|
|
|
template {
|
|
data = <<EOF
|
|
{{ with secret "kv/data/camptules" }}
|
|
{{ .Data.data.ytb_api_key }}
|
|
{{ end }}
|
|
EOF
|
|
destination = "secrets/ytb-api-key"
|
|
}
|
|
}
|
|
}
|
|
}
|