From b4c2bf8833fe96d22e97bbbcc7aefff52e590d53 Mon Sep 17 00:00:00 2001 From: romer8 Date: Thu, 14 Mar 2024 14:16:34 -0600 Subject: [PATCH] Added check to do not add the database settings to the portal config if it is postgresql --- docker/salt/tethyscore.sls | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/docker/salt/tethyscore.sls b/docker/salt/tethyscore.sls index 32e48c2af..0da755865 100644 --- a/docker/salt/tethyscore.sls +++ b/docker/salt/tethyscore.sls @@ -70,20 +70,12 @@ {% set TETHYS_SITE_CONTENT = TETHYS_SITE_CONTENT_LIST|join(' ') %} - - Generate_Tethys_Settings_TethysCore: cmd.run: - name: > tethys settings --set DEBUG {{ DEBUG }} --set ALLOWED_HOSTS {{ ALLOWED_HOSTS }} - --set DATABASES.default.ENGINE "{{ TETHYS_DB_ENGINE }}" - --set DATABASES.default.NAME "{{ TETHYS_DB_NAME }}" - --set DATABASES.default.USER "{{ TETHYS_DB_USERNAME }}" - --set DATABASES.default.PASSWORD "{{ TETHYS_DB_PASSWORD }}" - --set DATABASES.default.HOST "{{ TETHYS_DB_HOST }}" - --set DATABASES.default.PORT "{{ TETHYS_DB_PORT }}" --set INSTALLED_APPS {{ ADD_DJANGO_APPS }} --set SESSION_CONFIG.SECURITY_WARN_AFTER {{ SESSION_WARN }} --set SESSION_CONFIG.SECURITY_EXPIRE_AFTER {{ SESSION_EXPIRE }} @@ -101,6 +93,22 @@ Generate_Tethys_Settings_TethysCore: {{ OTHER_SETTINGS }} - unless: /bin/bash -c "[ -f "{{ TETHYS_PERSIST }}/setup_complete" ];" +{% if TETHYS_DB_ENGINE == 'django.db.backends.postgresql' %} +Generate_Tethys_DB_Conditional_Settings_TethysCore: + cmd.run: + - name: > + tethys settings + --set DEBUG {{ DEBUG }} + --set ALLOWED_HOSTS {{ ALLOWED_HOSTS }} + --set DATABASES.default.ENGINE "{{ TETHYS_DB_ENGINE }}" + --set DATABASES.default.NAME "{{ TETHYS_DB_NAME }}" + --set DATABASES.default.USER "{{ TETHYS_DB_USERNAME }}" + --set DATABASES.default.PASSWORD "{{ TETHYS_DB_PASSWORD }}" + --set DATABASES.default.HOST "{{ TETHYS_DB_HOST }}" + --set DATABASES.default.PORT "{{ TETHYS_DB_PORT }}" + - unless: /bin/bash -c "[ -f "{{ TETHYS_PERSIST }}/setup_complete" ];" +{% endif %} + Generate_NGINX_Settings_TethysCore: cmd.run: - name: >