Files
NomadBackup/nomad_backup/20251115_142246/sonarr.json
2025-11-21 13:07:40 -08:00

10 lines
4.8 KiB
JSON

{
"Format": "hcl2",
"JobID": "sonarr",
"JobModifyIndex": 13991917,
"Namespace": "default",
"Source": "# There can only be a single job definition per file.\n# Create a job with ID and Name 'example'\njob \"sonarr\" {\n datacenters = [\"dc1\"]\n type = \"service\"\n\n constraint {\n attribute = \"${attr.kernel.name}\"\n value = \"linux\"\n }\n constraint {\n attribute = \"${attr.cpu.arch}\"\n operator = \"regexp\"\n value = \"amd64\"\n }\n \n update {\n stagger = \"10s\"\n max_parallel = 1\n }\n group \"sonarr\" {\n count = 1\n\n restart {\n attempts = 2\n interval = \"1m\"\n delay = \"10s\"\n mode = \"fail\"\n }\n\n task \"sonarr\" {\n // 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\"] // }\n\n driver = \"docker\"\n\n config {\n image = \"linuxserver/sonarr:develop\"\n\n ports = [\"http\"]\n\n // dns_servers = [\"192.168.1.1\", \"1.1.1.1\"]\n memory_hard_limit = \"2048\"\n // cpuset_cpus = \"4-7\"\n\n volumes = [\n \"/mnt/Public/Downloads/news:/downloads\",\n \"/mnt/Public/Downloads/tv:/tv\",\n // \"/mnt/configs/sonarr:/config\",\n \"/mnt/Public/configs/sonarr_pg:/config\",\n // \"local/config.xml:/config/config.xml\"\n ]\n\n // \"/mnt/gv0/sonarr:/config\",\n force_pull = false\n }\n\n service {\n name = \"${TASKGROUP}\"\n tags = [\"sonarr\", \"tools\"]\n port = \"http\"\n\n check {\n type = \"script\"\n name = \"check_up\"\n command = \"/local/healthcheck.sh\"\n interval = \"60s\"\n timeout = \"5s\"\n\n check_restart {\n limit = 3\n grace = \"90s\"\n ignore_warnings = false\n } \n }\n }\n template {\n data = <<EOH\n#!/bin/bash\n/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')\"\n EOH\n\n destination = \"local/healthcheck.sh\"\n perms = \"0755\"\n }\n\n template {\n data = \"---\\nkey: {{ key \\\"ovpn-client\\\" }}\"\n destination = \"local/file.yml\"\n change_mode = \"restart\"\n }\n template {\n data = <<EOH\n<Config>\n<LogLevel>Info</LogLevel>\n<Port>8989</Port>\n<UrlBase>/sonarr</UrlBase>\n<BindAddress>*</BindAddress>\n<SslPort>9898</SslPort>\n<EnableSsl>False</EnableSsl>\n<ApiKey>1632787062fb47a9a6eb4c88e32b3ff3</ApiKey>\n<AuthenticationMethod>None</AuthenticationMethod>\n<Branch>develop</Branch>\n<LaunchBrowser>True</LaunchBrowser>\n<SslCertHash/>\n<UpdateMechanism>Docker</UpdateMechanism>\n<AnalyticsEnabled>False</AnalyticsEnabled>\n<UpdateScriptPath>/config/restart.sh</UpdateScriptPath>\n<InstanceName>Sonarr</InstanceName>\n<PostgresUser>postgres</PostgresUser>\n<PostgresPassword>postgres</PostgresPassword>\n<PostgresPort>5432</PostgresPort>\n<PostgresHost>master.postgres.service.dc1.consul</PostgresHost>\n</Config>\n EOH\n\n destination = \"local/config.xml\"\n perms = \"0755\"\n }\n env {\n // SHARE = \"Public;/mount/Public;yes;no;yes;all;none;;Public\"\n # GLOBAL = \"socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536\"\n # PERMISSIONS = \"true\"\n # WORKGROUP = \"WORKGROUP\"\n TZ = \"EST5EDT\"\n\n PUID = 1000\n PGID = 1000\n }\n\n # We must specify the resources required for\n # this task to ensure it runs on a machine with\n # enough capacity.\n resources {\n cpu = 500 # 500 MHz\n memory = 256 # 128MB\n }\n\n # Specify configuration related to log rotation\n logs {\n max_files = 12\n max_file_size = 15\n }\n\n # Controls the timeout between signalling a task it will be killed\n # and killing the task. If not set a default is used.\n kill_timeout = \"10s\"\n } #End main task\n\n network {\n // mbits = 100\n\n port \"http\" {\n static = 8989\n to = 8989\n }\n }\n }\n}\n",
"VariableFlags": null,
"Variables": "",
"Version": 20
}