From fcff87996512e898c00dd1be774e8b185aef219c Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Wed, 26 Oct 2016 12:37:38 +0200 Subject: [PATCH] ../library/roles/smartgears/tabular_data/defaults/main.yml first defintion ../library/roles/smartgears/tabular_data/handlers/main.yml first definition ../library/roles/smartgears/tabular_data/tasks/main.yml first definition --- smartgears/tabular_data/defaults/main.yml | 8 ++++++++ smartgears/tabular_data/handlers/main.yml | 3 +++ smartgears/tabular_data/tasks/main.yml | 25 +++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 smartgears/tabular_data/defaults/main.yml create mode 100644 smartgears/tabular_data/handlers/main.yml create mode 100644 smartgears/tabular_data/tasks/main.yml diff --git a/smartgears/tabular_data/defaults/main.yml b/smartgears/tabular_data/defaults/main.yml new file mode 100644 index 00000000..76028272 --- /dev/null +++ b/smartgears/tabular_data/defaults/main.yml @@ -0,0 +1,8 @@ +--- +gcube_repository: gcube-staging +tabular_data_install: False +tabular_data_version: 1.7.4-4.1.0-125864 +tabular_data_name: tabular-data-manager +tabular_data_file: '{{ tabular_data_name }}-{{ tabular_data_version }}.war' +tabular_data_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}/org/gcube/data/analysis/tabulardata/{{tabular_data_name}}/{{ tabular_data_version }}/{{ tabular_data_file }}' + diff --git a/smartgears/tabular_data/handlers/main.yml b/smartgears/tabular_data/handlers/main.yml new file mode 100644 index 00000000..a9b4ffdd --- /dev/null +++ b/smartgears/tabular_data/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: Restart smartgears + service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted diff --git a/smartgears/tabular_data/tasks/main.yml b/smartgears/tabular_data/tasks/main.yml new file mode 100644 index 00000000..19018cb4 --- /dev/null +++ b/smartgears/tabular_data/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- block: + + - name: Remove the old tabulardata files + file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=absent + when: ( tabular_data_install ) or ( smartgears_upgrade ) + + + # NOTE: Install as the smartgears user so we do not mess with the permissions + - name: Get the tabular-data-service + get_url: url={{ tabular_data_url }} dest={{ smartgears_user_home }}/{{ tabular_data_file }} + when: tabular_data_install + + - name: Create the tabular data working directory + file: path={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} + when: tabula_data_install + + - name: Unarchive the tabular data war + unarchive: copy=no src={{ smartgears_user_home }}/{{ tabular_data_file }} dest={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }} creates={{ smartgears_instance_path }}/webapps/{{ tabular_data_name }}/WEB-INF/lib + when: tabular_data_install + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + tags: [ 'smartgears', 'tabular_data', 'tomcat' ]