cluster/nomad/regions/homelab-1/job/camptules.hcl
main 1b51d5ae56 General clean up and a switch back to Docker
Signed-off-by: main <magic_rb@redalder.org>
2022-10-27 11:43:27 +02:00

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"
}
}
}
}