From b5086d02c903b5e40b42181610a26c9e0a657b8d Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 16 Mar 2017 16:34:43 +0100 Subject: [PATCH] d4science-ghn-cluster: The geoserver spatial servers now use the datatransfer that comes with the smartgears distribution. library/roles/smartgears/data-transfer-service: Not needed anymore. library/roles/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2: Enable the data-transfer-service reverse proxy when requested. --- .../data-transfer-service/defaults/main.yml | 9 ------- .../data-transfer-service/tasks/main.yml | 26 ------------------- .../defaults/main.yml | 1 + .../generic-smartgears-virtualhost.j2 | 20 ++++++++++++-- 4 files changed, 19 insertions(+), 37 deletions(-) delete mode 100644 smartgears/data-transfer-service/defaults/main.yml delete mode 100644 smartgears/data-transfer-service/tasks/main.yml diff --git a/smartgears/data-transfer-service/defaults/main.yml b/smartgears/data-transfer-service/defaults/main.yml deleted file mode 100644 index 55b126c4..00000000 --- a/smartgears/data-transfer-service/defaults/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -data_transfer_service_install: False -data_transfer_service_version: 1.2.1-4.3.0-141906 -data_transfer_service_name: data-transfer-service -data_transfer_group_id: org.gcube.data.transfer -data_transfer_extension: war -data_transfer_service_file: '{{ data_transfer_service_name }}-{{ data_transfer_service_version }}.{{ data_transfer_extension }}' -data_transfer_service_repository_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}' - diff --git a/smartgears/data-transfer-service/tasks/main.yml b/smartgears/data-transfer-service/tasks/main.yml deleted file mode 100644 index 8aa4cf9f..00000000 --- a/smartgears/data-transfer-service/tasks/main.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- block: - - name: Remove the old data transfer files - file: path={{ smartgears_instance_path }}/webapps/{{ data_transfer_service_name }} state=absent - - become: True - become_user: '{{ d4science_user }}' - when: ( not data_transfer_service_install ) or ( smartgears_upgrade ) - tags: [ 'smartgears', 'data_transfer_service', 'tomcat' ] - -- block: - # NOTE: Install as the smartgears user so we do not mess with the permissions - - name: Get the data-transfer-service war - maven_artifact: artifact_id={{ data_transfer_service_name }} version={{ data_transfer_service_version | default(omit) }} group_id={{ data_transfer_group_id }} extension={{ data_transfer_extension | default('war') }} repository_url={{ data_transfer_service_repository_url }} dest={{ smartgears_user_home }}/{{ data_transfer_service_file }} - - - name: Create the data trasfer working directory - file: path={{ smartgears_instance_path }}/webapps/{{ data_transfer_service_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} - - - name: Unarchive the data_transfer_service war - unarchive: copy=no src={{ smartgears_user_home }}/{{ data_transfer_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ data_transfer_service_name }} creates={{ smartgears_instance_path }}/webapps/{{ data_transfer_service_name }}/WEB-INF/lib - notify: Restart smartgears - - become: True - become_user: '{{ d4science_user }}' - when: data_transfer_service_install - tags: [ 'smartgears', 'data_transfer_service', 'tomcat' ] diff --git a/smartgears/smartgears-nginx-frontend/defaults/main.yml b/smartgears/smartgears-nginx-frontend/defaults/main.yml index c5fd6f87..4f10d081 100644 --- a/smartgears/smartgears-nginx-frontend/defaults/main.yml +++ b/smartgears/smartgears-nginx-frontend/defaults/main.yml @@ -6,3 +6,4 @@ smartgears_install_generic_virthost: True #smartgears_nginx_serveraliases: smartgears_nginx_cors_enabled: False nginx_cors_acl_origin: '' +data_transfer_service_install: False diff --git a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 index 69107ef9..54f8c4f3 100644 --- a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 +++ b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 @@ -70,7 +70,15 @@ server { {% if smartgears_nginx_cors_enabled %} include /etc/nginx/snippets/nginx-cors.conf; {% endif %} - proxy_pass http://localhost:{{ item.http_port }}{{ smart_executor_context }}; + proxy_pass http://localhost:{{ smartgears_http_port }}{{ smart_executor_context }}; + } + {% endif %} + {% if data_transfer_service_install %} + location /data-transfer-service { + {% if smartgears_nginx_cors_enabled %} + include /etc/nginx/snippets/nginx-cors.conf; + {% endif %} + proxy_pass http://localhost:{{ smartgears_http_port }}/data-transfer-service; } {% endif %} {% if rstudio_install_server is defined and rstudio_install_server %} @@ -165,7 +173,15 @@ server { {% if smartgears_nginx_cors_enabled %} include /etc/nginx/snippets/nginx-cors.conf; {% endif %} - proxy_pass http://localhost:{{ item.http_port }}{{ smart_executor_context }}; + proxy_pass http://localhost:{{ smartgears_http_port }}{{ smart_executor_context }}; + } + {% endif %} + {% if data_transfer_service_install %} + location /data-transfer-service { + {% if smartgears_nginx_cors_enabled %} + include /etc/nginx/snippets/nginx-cors.conf; + {% endif %} + proxy_pass http://localhost:{{ smartgears_http_port }}/data-transfer-service; } {% endif %} {% if rstudio_install_server is defined and rstudio_install_server %}