From 12608c73570b24867b52af9658cbec7ab0ab74ee Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 5 Sep 2017 13:28:47 +0200 Subject: [PATCH 1/4] Fix a task description. --- smartgears/gcube-oauth/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smartgears/gcube-oauth/tasks/main.yml b/smartgears/gcube-oauth/tasks/main.yml index 5a3f34f3..f15d8695 100644 --- a/smartgears/gcube-oauth/tasks/main.yml +++ b/smartgears/gcube-oauth/tasks/main.yml @@ -13,7 +13,7 @@ - name: Get the gcube-oauth war maven_artifact: artifact_id={{ gcube_oauth_name }} version={{ gcube_oauth_version | default(omit) }} group_id={{ gcube_oauth_group_id }} extension={{ gcube_oauth_extension | default('war') }} repository_url={{ gcube_oauth_repository_url }} dest={{ smartgears_user_home }}/{{ gcube_oauth_file }} - - name: Create the data trasfer working directory + - name: Create the gcube-oauth working directory file: path={{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} - name: Unarchive the gcube_oauth war From d9569fda96a9a035a6ce11a713b73d879b8eb415 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 5 Sep 2017 13:32:49 +0200 Subject: [PATCH 2/4] Fix a path. --- smartgears/gcube-oauth/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smartgears/gcube-oauth/tasks/main.yml b/smartgears/gcube-oauth/tasks/main.yml index f15d8695..307c28c0 100644 --- a/smartgears/gcube-oauth/tasks/main.yml +++ b/smartgears/gcube-oauth/tasks/main.yml @@ -1,7 +1,7 @@ --- - block: - name: Remove the old gcube oauth files - file: path={{ smartgears_instance_path }}/webapps/{{ gcube_oauth_name }} state=absent + file: path={{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }} state=absent become: True become_user: '{{ d4science_user }}' From 9dd57eee3d91b22bcdcb3eb58d6f6d850cb9e5fa Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 5 Sep 2017 16:00:52 +0200 Subject: [PATCH 3/4] library/roles/thredds: role that installs thredds http://www.unidata.ucar.edu/software/thredds/current/tds/TDS.html --- thredds/defaults/main.yml | 11 +++++++++++ thredds/tasks/main.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 thredds/defaults/main.yml create mode 100644 thredds/tasks/main.yml diff --git a/thredds/defaults/main.yml b/thredds/defaults/main.yml new file mode 100644 index 00000000..0d2dd49e --- /dev/null +++ b/thredds/defaults/main.yml @@ -0,0 +1,11 @@ +--- +thredds_install: False +thredds_upgrade: False +thredds_version: 4.6.9 +thredds_name: tds +thredds_app_name: thredds +thredds_group_id: edu.ucar.tds +thredds_extension: war +thredds_file: '{{ thredds_name }}-{{ thredds_version }}.{{ thredds_extension }}' +thredds_repository_url: 'https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases' +thredds_download_directory: /srv diff --git a/thredds/tasks/main.yml b/thredds/tasks/main.yml new file mode 100644 index 00000000..7faf8c32 --- /dev/null +++ b/thredds/tasks/main.yml @@ -0,0 +1,32 @@ +--- +- block: + - name: Remove the Thredds webapp directory + file: path={{ item.instance_path }}/webapps/{{ thredds_app_name }} state=absent + with_items: '{{ tomcat_m_instances }}' + notify: tomcat instances restart + + - name: Remove the Thredds download and data directories + file: path={{ item }} state=absent + with_items: + - '{{ thredds_download_directory }}' + - '{{ thredds_data_directory }}' + + when: not thredds_install or thredds_upgrade + tags: [ 'thredds', 'tomcat' ] + +- block: + - name: Create the Thredds webapp directory + file: path={{ item.instance_path }}/webapps/{{ thredds_app_name }} state=directory owner={{ item.user }} group={{ item.user }} + with_items: '{{ tomcat_m_instances }}' + + - name: Get the thredds war file + maven_artifact: artifact_id={{ thredds_name }} version={{ thredds_version | default(omit) }} group_id={{ thredds_group_id }} extension={{ thredds_extension | default('war') }} repository_url={{ thredds_repository_url }} dest={{ thredds_download_directory }}/{{ thredds_file }} + + - name: Unarchive the thredds war + unarchive: copy=no src={{ smartgears_user_home }}/{{ thredds_file }} dest={{ item.instance_path }}/webapps/{{ thredds_app_name }} creates={{ item.instance_path }}/webapps/{{ thredds_app_name }}/WEB-INF/lib owner={{ item.user }} group={{ item.user }} + with_items: '{{ tomcat_m_instances }}' + notify: tomcat instances restart + + when: thredds_install + tags: [ 'thredds', 'tomcat' ] + From 822c7488af4119629a7c2072fd0a8ec3b09ddb2e Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 5 Sep 2017 17:40:52 +0200 Subject: [PATCH 4/4] Fixes to the thredds role. Add two templates for the main configuration files. --- thredds/defaults/main.yml | 13 +- thredds/tasks/main.yml | 22 +- thredds/templates/catalog.xml.j2 | 42 ++++ thredds/templates/threddsConfig.xml.j2 | 271 +++++++++++++++++++++++++ 4 files changed, 337 insertions(+), 11 deletions(-) create mode 100644 thredds/templates/catalog.xml.j2 create mode 100644 thredds/templates/threddsConfig.xml.j2 diff --git a/thredds/defaults/main.yml b/thredds/defaults/main.yml index 0d2dd49e..9ad026a1 100644 --- a/thredds/defaults/main.yml +++ b/thredds/defaults/main.yml @@ -3,9 +3,18 @@ thredds_install: False thredds_upgrade: False thredds_version: 4.6.9 thredds_name: tds -thredds_app_name: thredds -thredds_group_id: edu.ucar.tds +thredds_app_name: Thredds +thredds_group_id: edu.ucar thredds_extension: war thredds_file: '{{ thredds_name }}-{{ thredds_version }}.{{ thredds_extension }}' thredds_repository_url: 'https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases' thredds_download_directory: /srv +thredds_data_content_dir: /data/thredds +thredds_public_netcdf_dir: '{{ thredds_data_content_dir }}/public/netcdf/' +thredds_server_name: 'Thredds instance' +thredds_logo_url: '/thredds/threddsIcon.gif' +thredds_logo_alt_text: '{{ thredds_server_name }}' +thredds_organization: 'ORG' +thredds_email: '' +thredds_host_institution_name: 'ORG' +thredds_host_institution_web: '' diff --git a/thredds/tasks/main.yml b/thredds/tasks/main.yml index 7faf8c32..a94063a7 100644 --- a/thredds/tasks/main.yml +++ b/thredds/tasks/main.yml @@ -1,29 +1,33 @@ --- - block: - name: Remove the Thredds webapp directory - file: path={{ item.instance_path }}/webapps/{{ thredds_app_name }} state=absent + file: path={{ item.instance_path }}/webapps/{{ thredds_app_name | lower }} state=absent with_items: '{{ tomcat_m_instances }}' notify: tomcat instances restart - - name: Remove the Thredds download and data directories - file: path={{ item }} state=absent - with_items: - - '{{ thredds_download_directory }}' - - '{{ thredds_data_directory }}' - when: not thredds_install or thredds_upgrade tags: [ 'thredds', 'tomcat' ] - block: - name: Create the Thredds webapp directory - file: path={{ item.instance_path }}/webapps/{{ thredds_app_name }} state=directory owner={{ item.user }} group={{ item.user }} + file: path={{ item.instance_path }}/webapps/{{ thredds_app_name | lower }} state=directory owner={{ item.user }} group={{ item.user }} with_items: '{{ tomcat_m_instances }}' + - name: Create the Thredds data directory + file: path={{ thredds_data_content_dir }} state=directory owner={{ item.user }} group={{ item.user }} + with_items: '{{ tomcat_m_instances }}' + + - name: Install the Thredds configuration files + template: src={{ item }}.j2 dest={{ thredds_data_content_dir }}/thredds/{{ item }} mode=444 + with_items: + - threddsConfig.xml + - catalog.xml + - name: Get the thredds war file maven_artifact: artifact_id={{ thredds_name }} version={{ thredds_version | default(omit) }} group_id={{ thredds_group_id }} extension={{ thredds_extension | default('war') }} repository_url={{ thredds_repository_url }} dest={{ thredds_download_directory }}/{{ thredds_file }} - name: Unarchive the thredds war - unarchive: copy=no src={{ smartgears_user_home }}/{{ thredds_file }} dest={{ item.instance_path }}/webapps/{{ thredds_app_name }} creates={{ item.instance_path }}/webapps/{{ thredds_app_name }}/WEB-INF/lib owner={{ item.user }} group={{ item.user }} + unarchive: copy=no src={{ thredds_download_directory }}/{{ thredds_file }} dest={{ item.instance_path }}/webapps/{{ thredds_app_name | lower }} creates={{ item.instance_path }}/webapps/{{ thredds_app_name | lower }}/WEB-INF/lib owner={{ item.user }} group={{ item.user }} with_items: '{{ tomcat_m_instances }}' notify: tomcat instances restart diff --git a/thredds/templates/catalog.xml.j2 b/thredds/templates/catalog.xml.j2 new file mode 100644 index 00000000..5d476f68 --- /dev/null +++ b/thredds/templates/catalog.xml.j2 @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + all + + + + + + + + + + + + + + + + diff --git a/thredds/templates/threddsConfig.xml.j2 b/thredds/templates/threddsConfig.xml.j2 new file mode 100644 index 00000000..2001d53a --- /dev/null +++ b/thredds/templates/threddsConfig.xml.j2 @@ -0,0 +1,271 @@ + + + + + + + {{ thredds_server_name }} + {{ thredds_logo_url }} + {{ thredds_server_name }} + + Scientific Data + meteorology, atmosphere, climate, ocean, earth science + + + Support + {{ thredds_organization }} + {{ thredds_email }} + + + + {{ thredds_host_institution_name }} + {{ thredds_host_institution_web }} + + + + + + + + + tds.css + tdsCat.css + tdsDap.css + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + true + false + 15 min + 30 min + + + + + + true + false + 2048 + 2048 + + + + + + true + true + true + + + + + + + + + + + + + + + + + +