From 4cf2b816230bdad47371399fb6ad44a4c06954a3 Mon Sep 17 00:00:00 2001 From: Seth Grover Date: Mon, 21 Nov 2022 06:58:08 -0700 Subject: [PATCH] don't report netbox services as unhealthy if they are disabled --- docker-compose-standalone.yml | 6 +++--- docker-compose.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-compose-standalone.yml b/docker-compose-standalone.yml index 57db68075..12a27b3ad 100644 --- a/docker-compose-standalone.yml +++ b/docker-compose-standalone.yml @@ -920,7 +920,7 @@ services: - ./nginx/ca-trust:/var/local/ca-trust:ro - ./netbox/postgres:/var/lib/postgresql/data:rw healthcheck: - test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ] + test: [ "CMD-SHELL", "[[ $${NETBOX_POSTGRES_DISABLED} == 'true' ]] || pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ] interval: 60s timeout: 15s retries: 3 @@ -947,7 +947,7 @@ services: - ./nginx/ca-trust:/var/local/ca-trust:ro - ./netbox/redis:/data healthcheck: - test: ["CMD-SHELL", "pidof redis-server || exit 1" ] + test: ["CMD-SHELL", "[[ $${NETBOX_REDIS_DISABLED} == 'true' ]] || ( pidof redis-server || exit 1 )" ] interval: 60s timeout: 15s retries: 3 @@ -973,7 +973,7 @@ services: volumes: - ./nginx/ca-trust:/var/local/ca-trust:ro healthcheck: - test: ["CMD-SHELL", "pidof redis-server || exit 1" ] + test: ["CMD-SHELL", "[[ $${NETBOX_REDIS_DISABLED} == 'true' ]] || ( pidof redis-server || exit 1 )" ] interval: 60s timeout: 15s retries: 3 diff --git a/docker-compose.yml b/docker-compose.yml index b5713bf1f..fa3862f18 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -986,7 +986,7 @@ services: - ./nginx/ca-trust:/var/local/ca-trust:ro - ./netbox/postgres:/var/lib/postgresql/data:rw healthcheck: - test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ] + test: [ "CMD-SHELL", "[[ $${NETBOX_POSTGRES_DISABLED} == 'true' ]] || pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ] interval: 60s timeout: 15s retries: 3 @@ -1016,7 +1016,7 @@ services: - ./nginx/ca-trust:/var/local/ca-trust:ro - ./netbox/redis:/data healthcheck: - test: ["CMD-SHELL", "pidof redis-server || exit 1" ] + test: ["CMD-SHELL", "[[ $${NETBOX_REDIS_DISABLED} == 'true' ]] || ( pidof redis-server || exit 1 )" ] interval: 60s timeout: 15s retries: 3 @@ -1045,7 +1045,7 @@ services: volumes: - ./nginx/ca-trust:/var/local/ca-trust:ro healthcheck: - test: ["CMD-SHELL", "pidof redis-server || exit 1" ] + test: ["CMD-SHELL", "[[ $${NETBOX_REDIS_DISABLED} == 'true' ]] || ( pidof redis-server || exit 1 )" ] interval: 60s timeout: 15s retries: 3