Add ddclient
This commit is contained in:
parent
b996e745ec
commit
5e1d1de521
8
core.tf
8
core.tf
@ -78,6 +78,14 @@ resource "nomad_job" "syslog-ng" {
|
||||
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" {
|
||||
name = "syslogng-promtail"
|
||||
kind = "service-intentions"
|
||||
|
51
ddclient.nomad
Normal file
51
ddclient.nomad
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user