cluster/nomad/regions/homelab-1/job/camptules.hcl

59 lines
969 B
HCL
Raw Normal View History

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 = "containerd-driver"
config {
flake_ref = "${var.flake_ref}#nixngSystems.camptules.config.system.build.toplevel"
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"
}
}
}
}