chore: backup Nomad jobs [skip ci]
This commit is contained in:
158
nomad_backup/sonarr.hcl
Normal file
158
nomad_backup/sonarr.hcl
Normal file
@@ -0,0 +1,158 @@
|
||||
# There can only be a single job definition per file.
|
||||
# Create a job with ID and Name 'example'
|
||||
job "sonarr" {
|
||||
datacenters = ["dc1"]
|
||||
type = "service"
|
||||
|
||||
constraint {
|
||||
attribute = "${attr.kernel.name}"
|
||||
value = "linux"
|
||||
}
|
||||
constraint {
|
||||
attribute = "${attr.cpu.arch}"
|
||||
operator = "regexp"
|
||||
value = "amd64"
|
||||
}
|
||||
|
||||
update {
|
||||
stagger = "10s"
|
||||
max_parallel = 1
|
||||
}
|
||||
group "sonarr" {
|
||||
count = 1
|
||||
|
||||
restart {
|
||||
attempts = 2
|
||||
interval = "1m"
|
||||
delay = "10s"
|
||||
mode = "fail"
|
||||
}
|
||||
|
||||
task "sonarr" {
|
||||
// driver = "raw_exec" // config { // command = "docker" // args = ["run", // "--rm", // "--name=sonarr", // "-e", "PUID=1000", // "-e", "PGID=1000", // "-e", "TZ=EST5EDT", // "-p", "8989:8989", // "-v", "/mnt/syncthing/sonarrv3:/config", // "-v", "/mnt/Public/Downloads/tv:/tv", // "-v", "/mnt/Public/Downloads/news:/downloads", // "--cpuset-cpus","4-7", // "linuxserver/sonarr:preview"] // }
|
||||
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "linuxserver/sonarr:develop"
|
||||
|
||||
ports = ["http"]
|
||||
|
||||
// dns_servers = ["192.168.1.1", "1.1.1.1"]
|
||||
memory_hard_limit = "2048"
|
||||
// cpuset_cpus = "4-7"
|
||||
|
||||
volumes = [
|
||||
"/mnt/Public/Downloads/news:/downloads",
|
||||
"/mnt/Public/Downloads/tv:/tv",
|
||||
// "/mnt/configs/sonarr:/config",
|
||||
"/mnt/Public/configs/sonarr_pg:/config",
|
||||
// "local/config.xml:/config/config.xml"
|
||||
]
|
||||
|
||||
// "/mnt/gv0/sonarr:/config",
|
||||
force_pull = false
|
||||
}
|
||||
|
||||
service {
|
||||
name = "${TASKGROUP}"
|
||||
tags = ["sonarr", "tools"]
|
||||
port = "http"
|
||||
|
||||
check {
|
||||
type = "script"
|
||||
name = "check_up"
|
||||
command = "/local/healthcheck.sh"
|
||||
interval = "60s"
|
||||
timeout = "5s"
|
||||
|
||||
check_restart {
|
||||
limit = 3
|
||||
grace = "90s"
|
||||
ignore_warnings = false
|
||||
}
|
||||
}
|
||||
}
|
||||
template {
|
||||
data = <<EOH
|
||||
#!/bin/bash
|
||||
/usr/bin/curl -f "http://localhost:${NOMAD_PORT_http}/api/v3/system/status?apikey=$(grep -Eo '<ApiKey>(.*)</ApiKey>' /config/config.xml | sed -e 's/<[^>]*>//g')"
|
||||
EOH
|
||||
|
||||
destination = "local/healthcheck.sh"
|
||||
perms = "0755"
|
||||
}
|
||||
|
||||
template {
|
||||
data = "---\nkey: {{ key \"ovpn-client\" }}"
|
||||
destination = "local/file.yml"
|
||||
change_mode = "restart"
|
||||
}
|
||||
template {
|
||||
data = <<EOH
|
||||
<Config>
|
||||
<LogLevel>Info</LogLevel>
|
||||
<Port>8989</Port>
|
||||
<UrlBase>/sonarr</UrlBase>
|
||||
<BindAddress>*</BindAddress>
|
||||
<SslPort>9898</SslPort>
|
||||
<EnableSsl>False</EnableSsl>
|
||||
<ApiKey>1632787062fb47a9a6eb4c88e32b3ff3</ApiKey>
|
||||
<AuthenticationMethod>None</AuthenticationMethod>
|
||||
<Branch>develop</Branch>
|
||||
<LaunchBrowser>True</LaunchBrowser>
|
||||
<SslCertHash/>
|
||||
<UpdateMechanism>Docker</UpdateMechanism>
|
||||
<AnalyticsEnabled>False</AnalyticsEnabled>
|
||||
<UpdateScriptPath>/config/restart.sh</UpdateScriptPath>
|
||||
<InstanceName>Sonarr</InstanceName>
|
||||
<PostgresUser>postgres</PostgresUser>
|
||||
<PostgresPassword>postgres</PostgresPassword>
|
||||
<PostgresPort>5432</PostgresPort>
|
||||
<PostgresHost>master.postgres.service.dc1.consul</PostgresHost>
|
||||
</Config>
|
||||
EOH
|
||||
|
||||
destination = "local/config.xml"
|
||||
perms = "0755"
|
||||
}
|
||||
env {
|
||||
// SHARE = "Public;/mount/Public;yes;no;yes;all;none;;Public"
|
||||
# GLOBAL = "socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536"
|
||||
# PERMISSIONS = "true"
|
||||
# WORKGROUP = "WORKGROUP"
|
||||
TZ = "EST5EDT"
|
||||
|
||||
PUID = 1000
|
||||
PGID = 1000
|
||||
}
|
||||
|
||||
# We must specify the resources required for
|
||||
# this task to ensure it runs on a machine with
|
||||
# enough capacity.
|
||||
resources {
|
||||
cpu = 500 # 500 MHz
|
||||
memory = 256 # 128MB
|
||||
}
|
||||
|
||||
# Specify configuration related to log rotation
|
||||
logs {
|
||||
max_files = 12
|
||||
max_file_size = 15
|
||||
}
|
||||
|
||||
# Controls the timeout between signalling a task it will be killed
|
||||
# and killing the task. If not set a default is used.
|
||||
kill_timeout = "10s"
|
||||
} #End main task
|
||||
|
||||
network {
|
||||
// mbits = 100
|
||||
|
||||
port "http" {
|
||||
static = 8989
|
||||
to = 8989
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user