You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2022/07/28 21:31:38 UTC

[airavata] branch develop updated: Ansible: allow configuring multiple user storages

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/develop by this push:
     new 6521fc1fb7 Ansible: allow configuring multiple user storages
6521fc1fb7 is described below

commit 6521fc1fb75ea2562bb42224e021df7e6ad1bb66
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Jul 28 17:31:10 2022 -0400

    Ansible: allow configuring multiple user storages
---
 .../scigap/develop-js2/group_vars/django/vars.yml            | 11 +++++++++--
 .../ansible/roles/django/templates/settings_local.py.j2      | 12 ++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/dev-tools/ansible/inventories/scigap/develop-js2/group_vars/django/vars.yml b/dev-tools/ansible/inventories/scigap/develop-js2/group_vars/django/vars.yml
index c3318dc5ca..a05e8a2044 100644
--- a/dev-tools/ansible/inventories/scigap/develop-js2/group_vars/django/vars.yml
+++ b/dev-tools/ansible/inventories/scigap/develop-js2/group_vars/django/vars.yml
@@ -22,8 +22,15 @@
 user: "pga"
 group: "pga"
 gateway_data_store_hostname: "web.dev.scigap.org"
-# gateway_data_store_resource_id: "pgadev.scigap.org_7ddf28fd-d503-4ff8-bbc5-3279a7c3b99e"
-gateway_data_store_resource_id: "web.dev.scigap.org_ba01452f-44e5-4e03-b35f-756630539198"
+django_gateway_user_storages:
+  - alias: "default"
+    storage_resource_id: "web.dev.scigap.org_ba01452f-44e5-4e03-b35f-756630539198"
+    options:
+      directory: "{{ experiment_data_dir }}"
+  - alias: "pgadev"
+    storage_resource_id: "pgadev.scigap.org_7ddf28fd-d503-4ff8-bbc5-3279a7c3b99e"
+    options:
+      directory: "{{ experiment_data_dir }}"
 django_wsgi_processes: 1
 doc_root_dir: "/var/www/portals/django-{{gateway_id}}"
 django_database_name: "django_{{ gateway_id }}"
diff --git a/dev-tools/ansible/roles/django/templates/settings_local.py.j2 b/dev-tools/ansible/roles/django/templates/settings_local.py.j2
index 285c626a04..bfce66c870 100644
--- a/dev-tools/ansible/roles/django/templates/settings_local.py.j2
+++ b/dev-tools/ansible/roles/django/templates/settings_local.py.j2
@@ -127,6 +127,17 @@ AIRAVATA_API_PORT = {{ api_server_port }}
 AIRAVATA_API_SECURE = False
 {% endif %}
 
+{% if django_gateway_user_storages is defined %}
+USER_STORAGES = {
+    {% for user_storage in django_gateway_user_storages %}
+    '{{ user_storage.alias }}': {
+        'BACKEND': '{{ user_storage.backend | default("airavata_django_portal_sdk.user_storage.backends.DjangoFileSystemProvider") }}',
+        'STORAGE_RESOURCE_ID': '{{ user_storage.storage_resource_id }}',
+        'OPTIONS': {{ user_storage.options | to_nice_json }},
+    },
+    {% endfor %}
+}
+{% else %}
 USER_STORAGES = {
     'default': {
         'BACKEND': 'airavata_django_portal_sdk.user_storage.backends.DjangoFileSystemProvider',
@@ -136,6 +147,7 @@ USER_STORAGES = {
         }
     }
 }
+{% endif %}
 
 FILE_UPLOAD_TEMP_DIR = "{{ file_upload_tmp_dir }}"