Add ddclient

This commit is contained in:
IamTheFij 2022-07-27 14:45:08 -07:00
parent 9664802fb6
commit bc040b4668
2 changed files with 59 additions and 0 deletions

View File

@ -78,6 +78,14 @@ resource "nomad_job" "syslog-ng" {
jobspec = file("${path.module}/syslogng.nomad") jobspec = file("${path.module}/syslogng.nomad")
} }
resource "nomad_job" "ddclient" {
hcl2 {
enabled = true
}
jobspec = file("${path.module}/ddclient.nomad")
}
resource "consul_config_entry" "syslogng_promtail_intent" { resource "consul_config_entry" "syslogng_promtail_intent" {
name = "syslogng-promtail" name = "syslogng-promtail"
kind = "service-intentions" kind = "service-intentions"

51
nomad/ddclient.nomad Normal file
View File

@ -0,0 +1,51 @@
job "ddclient" {
datacenters = ["dc1"]
type = "service"
group "ddclient" {
task "ddclient" {
driver = "docker"
config {
image = "linuxserver/ddclient:3.9.1"
mount {
type = "bind"
source = "local/ddclient.conf"
target = "/config/ddclient.conf"
}
}
vault {
policies = [
"access-tables",
"nomad-task",
]
}
template {
data = <<EOH
daemon=900
ssl=yes
use=web
protocol=cloudflare,
ttl=1,
{{ with secret "kv/data/cloudflare" -}}
password={{ .Data.data.api_token_dns_edit_all }}
{{ end -}}
zone={{ key "ddclient/zone" }}
{{ key "ddclient/domain" }}
EOH
destination = "local/ddclient.conf"
change_mode = "restart"
}
resources {
cpu = 50
memory = 20
}
}
}
}