Skip to content

Commit

Permalink
Added check to do not add the database settings to the portal config …
Browse files Browse the repository at this point in the history
…if it is postgresql
  • Loading branch information
romer8 committed Mar 14, 2024
1 parent 05ecee9 commit b4c2bf8
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions docker/salt/tethyscore.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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: >
Expand Down

0 comments on commit b4c2bf8

Please sign in to comment.