From 2c859a7f49b31a802cb7ecccda7fe9b9a0ef341a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 20 Jul 2017 13:49:50 +0200 Subject: [PATCH 1/5] brary/roles/smartgears/smartgears-nginx-frontend: Optionally expose the gcube logs via http. d4science-ghn-cluster: Expose the gcube logs on the dataminer servers. --- .../smartgears-nginx-frontend/defaults/main.yml | 1 + .../templates/generic-smartgears-virtualhost.j2 | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/smartgears/smartgears-nginx-frontend/defaults/main.yml b/smartgears/smartgears-nginx-frontend/defaults/main.yml index 4f10d08..b69e563 100644 --- a/smartgears/smartgears-nginx-frontend/defaults/main.yml +++ b/smartgears/smartgears-nginx-frontend/defaults/main.yml @@ -7,3 +7,4 @@ smartgears_install_generic_virthost: True smartgears_nginx_cors_enabled: False nginx_cors_acl_origin: '' data_transfer_service_install: False +smartgears_nginx_expose_tomcat_logs: False diff --git a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 index 04be5b9..5076e47 100644 --- a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 +++ b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 @@ -93,6 +93,15 @@ server { proxy_pass http://localhost:8787/; } {% endif %} + + {% if smartgears_nginx_expose_tomcat_logs %} + location /gcube-logs/ { + alias {{ smartgears_instance_path }}/logs/; + autoindex on; + autoindex_localtime on; + } + {% endif %} + {% else %} location / { {% if smartgears_nginx_cors_enabled %} @@ -198,5 +207,12 @@ server { } {% endif %} + {% if smartgears_nginx_expose_tomcat_logs %} + location /gcube-logs/ { + alias {{ smartgears_instance_path }}/logs; + autoindex on; + autoindex_localtime on; + } + {% endif %} } {% endif %} From 68ad035c61de5c426a276ee950f14b937501cdf2 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 20 Jul 2017 15:04:55 +0200 Subject: [PATCH 2/5] library/roles/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2: Fix a typo. --- .../templates/generic-smartgears-virtualhost.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 index 5076e47..6556a9e 100644 --- a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 +++ b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 @@ -209,7 +209,7 @@ server { {% if smartgears_nginx_expose_tomcat_logs %} location /gcube-logs/ { - alias {{ smartgears_instance_path }}/logs; + alias {{ smartgears_instance_path }}/logs/; autoindex on; autoindex_localtime on; } From 56eaf5e78391d2e4c0cdd6b50fb0fa00b57c21e7 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 20 Jul 2017 15:25:55 +0200 Subject: [PATCH 3/5] d4science-ghn-cluster/group_vars/all/gcube_vault_keys.yml library/roles/smartgears/dataminer_app/tasks/install-gcube-key.yml library/roles/smartgears/smartgears/tasks/install-gcube-keys.yml: New gcube keys. --- smartgears/dataminer_app/tasks/install-gcube-key.yml | 5 +++++ smartgears/smartgears/tasks/install-gcube-keys.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/smartgears/dataminer_app/tasks/install-gcube-key.yml b/smartgears/dataminer_app/tasks/install-gcube-key.yml index a38fd36..5394858 100644 --- a/smartgears/dataminer_app/tasks/install-gcube-key.yml +++ b/smartgears/dataminer_app/tasks/install-gcube-key.yml @@ -11,6 +11,7 @@ - '{{ gcube_prod_key_6 }}' - '{{ gcube_prod_key_7 }}' - '{{ gcube_prod_key_8 }}' + - '{{ gcube_prod_key_9 }}' notify: Restart smartgears when: install_gcube_prod_key @@ -22,6 +23,10 @@ - '{{ gcube_prod_key_3 }}' - '{{ gcube_prod_key_4 }}' - '{{ gcube_prod_key_5 }}' + - '{{ gcube_prod_key_6 }}' + - '{{ gcube_prod_key_7 }}' + - '{{ gcube_prod_key_8 }}' + - '{{ gcube_prod_key_9 }}' notify: Restart smartgears when: not install_gcube_prod_key diff --git a/smartgears/smartgears/tasks/install-gcube-keys.yml b/smartgears/smartgears/tasks/install-gcube-keys.yml index ad27e5f..9ad3f62 100644 --- a/smartgears/smartgears/tasks/install-gcube-keys.yml +++ b/smartgears/smartgears/tasks/install-gcube-keys.yml @@ -11,6 +11,7 @@ - '{{ gcube_prod_key_6 }}' - '{{ gcube_prod_key_7 }}' - '{{ gcube_prod_key_8 }}' + - '{{ gcube_prod_key_9 }}' notify: Restart smartgears when: install_gcube_prod_key @@ -22,6 +23,10 @@ - '{{ gcube_prod_key_3 }}' - '{{ gcube_prod_key_4 }}' - '{{ gcube_prod_key_5 }}' + - '{{ gcube_prod_key_6 }}' + - '{{ gcube_prod_key_7 }}' + - '{{ gcube_prod_key_8 }}' + - '{{ gcube_prod_key_9 }}' notify: Restart smartgears when: not install_gcube_prod_key From fcda3ef2b169511ae745fdef6673d5b5cca49560 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 20 Jul 2017 15:32:14 +0200 Subject: [PATCH 4/5] library/roles/smartgears/oscar_importer_se_plugin: Role that installs the oscar importer smart executor plugin. --- .../oscar_importer_se_plugin/defaults/main.yml | 12 ++++++++++++ smartgears/oscar_importer_se_plugin/tasks/main.yml | 14 ++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 smartgears/oscar_importer_se_plugin/defaults/main.yml create mode 100644 smartgears/oscar_importer_se_plugin/tasks/main.yml diff --git a/smartgears/oscar_importer_se_plugin/defaults/main.yml b/smartgears/oscar_importer_se_plugin/defaults/main.yml new file mode 100644 index 0000000..7a922db --- /dev/null +++ b/smartgears/oscar_importer_se_plugin/defaults/main.yml @@ -0,0 +1,12 @@ +--- +oscar_importer_se_plugin_install: False +oscar_importer_se_plugin_upgrade: False +oscar_importer_se_plugin_version: latest + +oscar_importer_se_plugin_group_id: 'org.gcube.dataanalysis' +oscar_importer_se_plugin_name: 'oscar-importer-se-plugin' +oscar_importer_se_plugin_extension: 'jar' +oscar_importer_se_plugin_classifier: 'jar-with-dependencies' +oscar_importer_se_plugin_file: '{{ oscar_importer_se_plugin_name }}-{{ oscar_importer_se_plugin_version }}-jar-with-dependencies.{{ oscar_importer_se_plugin_extension }}' + +# Note: the deb package libnetcdfc7 is required diff --git a/smartgears/oscar_importer_se_plugin/tasks/main.yml b/smartgears/oscar_importer_se_plugin/tasks/main.yml new file mode 100644 index 0000000..9e53bc2 --- /dev/null +++ b/smartgears/oscar_importer_se_plugin/tasks/main.yml @@ -0,0 +1,14 @@ +--- +- block: + - name: Remove the old oscar-importer plugin + shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/oscar-importer-se-plugin-*-jar-with-dependencies.jar + when: oscar_importer_se_plugin_upgrade + + - name: Install the oscar-importer plugin inside the smart executor lib directory + maven_artifact: artifact_id={{ oscar_importer_se_plugin_name }} version={{ oscar_importer_se_plugin_version | default(omit) }} group_id={{ oscar_importer_se_plugin_group_id }} extension={{ oscar_importer_se_plugin_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ oscar_importer_se_plugin_classifier }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ oscar_importer_se_plugin_file }} + notify: Restart smartgears + + become: True + become_user: '{{ smartgears_user }}' + when: oscar_importer_se_plugin_install + tags: [ 'smartgears', 'oscar_importer_se', 'tomcat' ] From 12a7a03c26100f0cd5ab79ea8322d8ddd6ac5b4a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 20 Jul 2017 15:39:40 +0200 Subject: [PATCH 5/5] library/roles/smartgears/oscar_importer_se_plugin/tasks/main.yml: Add a task to install the required package. --- smartgears/oscar_importer_se_plugin/tasks/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smartgears/oscar_importer_se_plugin/tasks/main.yml b/smartgears/oscar_importer_se_plugin/tasks/main.yml index 9e53bc2..4eca0a1 100644 --- a/smartgears/oscar_importer_se_plugin/tasks/main.yml +++ b/smartgears/oscar_importer_se_plugin/tasks/main.yml @@ -8,6 +8,9 @@ maven_artifact: artifact_id={{ oscar_importer_se_plugin_name }} version={{ oscar_importer_se_plugin_version | default(omit) }} group_id={{ oscar_importer_se_plugin_group_id }} extension={{ oscar_importer_se_plugin_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ oscar_importer_se_plugin_classifier }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ oscar_importer_se_plugin_file }} notify: Restart smartgears + - name: Install the libnetcdfc7 package + apt: pkg=libnetcdfc7 state=present update_cache=yes cache_valid_time=1800 + become: True become_user: '{{ smartgears_user }}' when: oscar_importer_se_plugin_install