157 lines
3.5 KiB
HCL
157 lines
3.5 KiB
HCL
# There can only be a single job definition per file.
|
|
# Create a job with ID and Name 'example'
|
|
job "radarr" {
|
|
datacenters = ["dc1"]
|
|
type = "service"
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
constraint {
|
|
attribute = "${attr.unique.hostname}"
|
|
operator = "regexp"
|
|
value = "odroid.*"
|
|
}
|
|
constraint {
|
|
attribute = "${attr.cpu.arch}"
|
|
operator = "regexp"
|
|
value = "arm64"
|
|
}
|
|
|
|
|
|
update {
|
|
stagger = "10s"
|
|
max_parallel = 1
|
|
}
|
|
|
|
group "radarr" {
|
|
count = 1
|
|
|
|
restart {
|
|
attempts = 5
|
|
interval = "1m"
|
|
delay = "10s"
|
|
mode = "delay"
|
|
}
|
|
|
|
task "radarr" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
// image = "linuxserver/radarr:nightly"
|
|
image = "linuxserver/radarr:latest"
|
|
dns_servers = ["${attr.unique.network.ip-address}","192.168.4.250","8.8.8.8"]
|
|
ports = ["http"]
|
|
memory_hard_limit = "2048"
|
|
// cpuset_cpus = "4-7"
|
|
|
|
volumes = [
|
|
"/mnt/Public/Downloads/news:/downloads",
|
|
"/mnt/Public/Downloads/movies:/movies",
|
|
// "/mnt/configs/radarr:/config",
|
|
"/mnt/Archive/Movies:/archive",
|
|
"/mnt/Public/configs/radarr_pg:/config",
|
|
// "local/config.xml:/config/config.xml"
|
|
]
|
|
}
|
|
|
|
template {
|
|
data = "---\nkey: {{ key \"ovpn-client\" }}"
|
|
destination = "local/file.yml"
|
|
change_mode = "restart"
|
|
}
|
|
template {
|
|
data = <<EOH
|
|
<Config>
|
|
<LogLevel>Info</LogLevel>
|
|
<Port>7878</Port>
|
|
<UrlBase/>
|
|
<BindAddress>*</BindAddress>
|
|
<SslPort>9898</SslPort>
|
|
<EnableSsl>False</EnableSsl>
|
|
<ApiKey>237c27f22504440385e5ee295fd65eb5</ApiKey>
|
|
<AuthenticationMethod>Forms</AuthenticationMethod>
|
|
<Branch>master</Branch>
|
|
<SslCertPath/>
|
|
<LaunchBrowser>True</LaunchBrowser>
|
|
<SslCertPassword/>
|
|
<UpdateMechanism>Docker</UpdateMechanism>
|
|
<AnalyticsEnabled>False</AnalyticsEnabled>
|
|
<InstanceName>Radarr</InstanceName>
|
|
<AuthenticationRequired>DisabledForLocalAddresses</AuthenticationRequired>
|
|
<PostgresUser>postgres</PostgresUser>
|
|
<PostgresPassword>postgres</PostgresPassword>
|
|
<PostgresPort>5432</PostgresPort>
|
|
<PostgresHost>master.postgres.service.dc1.consul</PostgresHost>
|
|
</Config>
|
|
EOH
|
|
|
|
destination = "local/config.xml"
|
|
perms = "0755"
|
|
}
|
|
|
|
service {
|
|
name = "${TASKGROUP}"
|
|
tags = ["radarr", "tools"]
|
|
port = "http"
|
|
|
|
check {
|
|
type = "script"
|
|
name = "check_up"
|
|
command = "/local/healthcheck.sh"
|
|
interval = "5m"
|
|
timeout = "25s"
|
|
|
|
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"
|
|
}
|
|
|
|
env {
|
|
TZ = "EST5EDT"
|
|
PUID = 1000
|
|
PGID = 1000
|
|
}
|
|
|
|
resources {
|
|
cpu = 500 # 500 MHz
|
|
memory = 256 # 128MB
|
|
|
|
// network {
|
|
// port "radarr" {
|
|
// static = "7878"
|
|
// }
|
|
// }
|
|
}
|
|
|
|
logs {
|
|
max_files = 10
|
|
max_file_size = 15
|
|
}
|
|
|
|
kill_timeout = "10s"
|
|
} #Task
|
|
|
|
network {
|
|
// mode = "bridge"
|
|
port "http" {
|
|
static = 7878
|
|
to = 7878
|
|
}
|
|
}
|
|
} #Group
|
|
}
|