From 33c8b91ef77c5edccf75b9088dc84d034071bebe Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Thu, 18 Jan 2024 16:16:48 +0000 Subject: [PATCH] Run netbox workers. --- services/netbox.hcl | 66 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/services/netbox.hcl b/services/netbox.hcl index e118756..d99753f 100644 --- a/services/netbox.hcl +++ b/services/netbox.hcl @@ -8,7 +8,7 @@ job "netbox" { } } - task "backend" { + task "frontend" { driver = "docker" config { @@ -51,5 +51,69 @@ job "netbox" { ] } } + + task "worker" { + driver = "docker" + + config { + image = "docker.io/netboxcommunity/netbox:v3.7-2.8.0" + command = "/opt/netbox/venv/bin/python" + args = [ + "/opt/netbox/netbox/manage.py", + "rqworker", + ] + volumes = [ + "/data/compute/appdata/netbox/configuration:/etc/netbox/config:z,ro", + "/data/compute/appdata/netbox/media:/opt/netbox/media", + "/data/compute/appdata/netbox/reports:/opt/netbox/reports", + "/data/compute/appdata/netbox/files:/opt/netbox/scripts", + ] + } + + env { + DB_HOST = "postgres.service.consul" + DB_NAME = "netbox" + DB_USER = "netbox" + DB_PASSWORD = "ik1chah5ae9Un7oozeiX" + EMAIL_FROM = "netbox@paler.net" + EMAIL_SERVER = "192.168.1.1" + GRAPHQL_ENABLED = "true" + HOUSEKEEPING_INTERVAL = "86400" + MEDIA_ROOT = "/opt/netbox/netbox/media" + REDIS_CACHE_HOST = "redis.service.consul" + REDIS_HOST = "redis.service.consul" + SECRET_KEY = "&EqXd#NTzIb2d2mvYxcOv5)&78fH5*Gq1&mstMGUaIyBfp-z+9" + } + } + + task "housekeeping" { + driver = "docker" + + config { + image = "docker.io/netboxcommunity/netbox:v3.7-2.8.0" + command = "/opt/netbox/housekeeping.sh" + volumes = [ + "/data/compute/appdata/netbox/configuration:/etc/netbox/config:z,ro", + "/data/compute/appdata/netbox/media:/opt/netbox/media", + "/data/compute/appdata/netbox/reports:/opt/netbox/reports", + "/data/compute/appdata/netbox/files:/opt/netbox/scripts", + ] + } + + env { + DB_HOST = "postgres.service.consul" + DB_NAME = "netbox" + DB_USER = "netbox" + DB_PASSWORD = "ik1chah5ae9Un7oozeiX" + EMAIL_FROM = "netbox@paler.net" + EMAIL_SERVER = "192.168.1.1" + GRAPHQL_ENABLED = "true" + HOUSEKEEPING_INTERVAL = "86400" + MEDIA_ROOT = "/opt/netbox/netbox/media" + REDIS_CACHE_HOST = "redis.service.consul" + REDIS_HOST = "redis.service.consul" + SECRET_KEY = "&EqXd#NTzIb2d2mvYxcOv5)&78fH5*Gq1&mstMGUaIyBfp-z+9" + } + } } }