first commit
This commit is contained in:
99
nomad_backup/20251115_142432/acme.hcl
Normal file
99
nomad_backup/20251115_142432/acme.hcl
Normal file
@@ -0,0 +1,99 @@
|
||||
job "acme" {
|
||||
datacenters = ["dc1"]
|
||||
type = "batch"
|
||||
|
||||
periodic {
|
||||
cron = "@weekly"
|
||||
prohibit_overlap = true
|
||||
}
|
||||
|
||||
group "acme" {
|
||||
restart {
|
||||
attempts = 1
|
||||
delay = "30s"
|
||||
}
|
||||
task "acme" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "neilpang/acme.sh"
|
||||
entrypoint = ["/local/acme_wrapper.sh"]
|
||||
volumes = [
|
||||
"/mnt/configs/${NOMAD_GROUP_NAME}:/acme.sh",
|
||||
]
|
||||
}
|
||||
env {
|
||||
DEDYN_TOKEN="JPwQpUiWGkKHSkmGEC4YAeGiGFki"
|
||||
DuckDNS_Token="e4b5ca33-1f4d-494b-b06d-6dd4600df662"
|
||||
CONSUL_URL="${attr.unique.network.ip-address}"
|
||||
|
||||
}
|
||||
|
||||
template {
|
||||
change_mode = "noop"
|
||||
data = "{{ key \"scripts/acme.sh\" }}"
|
||||
destination = "local/acme_wrapper.sh"
|
||||
perms = 0777
|
||||
}
|
||||
|
||||
|
||||
|
||||
resources {
|
||||
cpu = 256
|
||||
memory = 64
|
||||
}
|
||||
}
|
||||
|
||||
task "init" {
|
||||
driver = "docker"
|
||||
|
||||
lifecycle {
|
||||
hook = "prestart"
|
||||
sidecar = false
|
||||
}
|
||||
|
||||
config {
|
||||
image = "ghcr.io/sstent/rsync"
|
||||
memory_hard_limit = 2048
|
||||
|
||||
volumes = [
|
||||
"/mnt/configs/${NOMAD_GROUP_NAME}:/config",
|
||||
"/mnt/Public/config/${NOMAD_GROUP_NAME}:/configbackup",
|
||||
"/mnt/Public/config/locks:/locks",
|
||||
]
|
||||
|
||||
args = ["flock", "-x", "/locks/${NOMAD_GROUP_NAME}_rsync.lock", "rsync", "-avz","--delete-excluded","--exclude=renewal","--exclude='live'","--exclude='archive'","--exclude='keys'","--exclude='csr'", "/configbackup/", "/config/", "--delete-before"]
|
||||
}
|
||||
resources {
|
||||
cpu = 20 # 500 MHz
|
||||
memory = 20 # 128MB
|
||||
}
|
||||
} #end init task
|
||||
|
||||
task "finalsync" {
|
||||
driver = "docker"
|
||||
|
||||
lifecycle {
|
||||
hook = "poststop"
|
||||
}
|
||||
|
||||
config {
|
||||
// image = "pebalk/rsync"
|
||||
image = "ghcr.io/sstent/rsync"
|
||||
memory_hard_limit = 2048
|
||||
|
||||
volumes = [
|
||||
"/mnt/configs/${NOMAD_GROUP_NAME}:/config",
|
||||
"/mnt/Public/config/${NOMAD_GROUP_NAME}:/configbackup",
|
||||
"/mnt/Public/config/locks:/locks",
|
||||
]
|
||||
|
||||
args = ["flock", "-x", "/locks/${NOMAD_GROUP_NAME}_rsync.lock", "rsync", "-av","--delete-excluded","--exclude=renewal","--exclude='live'","--exclude='archive'","--exclude='keys'","--exclude='csr'", "/config/", "/configbackup/","--remove-source-files"]
|
||||
}
|
||||
resources {
|
||||
cpu = 20 # 500 MHz
|
||||
memory = 20 # 128MB
|
||||
}
|
||||
} #end finalsync task
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user