2022-07-27 21:45:08 +00:00
|
|
|
job "ddclient" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "service"
|
|
|
|
|
|
|
|
group "ddclient" {
|
|
|
|
|
|
|
|
task "ddclient" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
|
|
|
image = "linuxserver/ddclient:3.9.1"
|
|
|
|
|
|
|
|
mount {
|
|
|
|
type = "bind"
|
2022-09-07 19:20:58 +00:00
|
|
|
source = "secrets/ddclient.conf"
|
2022-07-27 21:45:08 +00:00
|
|
|
target = "/config/ddclient.conf"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vault {
|
|
|
|
policies = [
|
|
|
|
"access-tables",
|
|
|
|
"nomad-task",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOH
|
|
|
|
daemon=900
|
|
|
|
ssl=yes
|
|
|
|
use=web
|
|
|
|
|
|
|
|
protocol=cloudflare,
|
2022-09-07 19:20:58 +00:00
|
|
|
zone={{ key "ddclient/zone" }},
|
2022-07-27 21:45:08 +00:00
|
|
|
ttl=1,
|
|
|
|
{{ with secret "kv/data/cloudflare" -}}
|
2022-09-07 19:20:58 +00:00
|
|
|
login={{ .Data.data.api_user }},
|
|
|
|
password={{ .Data.data.api_key }}
|
|
|
|
# login=token,
|
|
|
|
# password={{ .Data.data.api_token_dns_edit_all }}
|
2022-07-27 21:45:08 +00:00
|
|
|
{{ end -}}
|
|
|
|
|
|
|
|
{{ key "ddclient/domain" }}
|
|
|
|
EOH
|
2022-09-07 19:20:58 +00:00
|
|
|
destination = "secrets/ddclient.conf"
|
2022-07-27 21:45:08 +00:00
|
|
|
change_mode = "restart"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 50
|
2022-09-07 19:20:58 +00:00
|
|
|
memory = 50
|
|
|
|
memory_max = 100
|
2022-07-27 21:45:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|