From b35b8cecd5a1228797bf7ee09b4568694ca462f1 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Tue, 13 Feb 2024 12:01:45 -0800 Subject: [PATCH] Blocky: Remove mysql and redis configs from stunnel if server isn't found --- core/blocky/blocky.nomad | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/blocky/blocky.nomad b/core/blocky/blocky.nomad index b312af3..f0e37d8 100644 --- a/core/blocky/blocky.nomad +++ b/core/blocky/blocky.nomad @@ -134,21 +134,21 @@ syslog = no foreground = yes delay = yes +{{ range nomadService 1 (env "NOMAD_ALLOC_ID") "mysql-tls" -}} [mysql_client] client = yes accept = 127.0.0.1:3306 -{{ range nomadService 1 (env "NOMAD_ALLOC_ID") "mysql-tls" -}} connect = {{ .Address }}:{{ .Port }} -{{- end }} PSKsecrets = {{ env "NOMAD_SECRETS_DIR" }}/mysql_stunnel_psk.txt +{{- end }} +{{ range nomadService 1 (env "NOMAD_ALLOC_ID") "redis-blocky" -}} [redis_client] client = yes accept = 127.0.0.1:6379 -{{ range nomadService 1 (env "NOMAD_ALLOC_ID") "redis-blocky" -}} connect = {{ .Address }}:{{ .Port }} -{{- end }} PSKsecrets = {{ env "NOMAD_SECRETS_DIR" }}/stunnel_psk.txt +{{- end }} EOF destination = "$${NOMAD_TASK_DIR}/stunnel.conf" }