From f005f5b224c71cc4c07ea7fa9fbaa37a1949bb44 Mon Sep 17 00:00:00 2001 From: Roberto Date: Fri, 28 Apr 2017 10:36:18 +0200 Subject: [PATCH] ../library/roles/smartgears/dm_pool_manager/defaults/main.yml added new service dm-pool-manager --- smartgears/dm_pool_manager/defaults/main.yml | 10 +++++++ smartgears/dm_pool_manager/handlers/main.yml | 3 ++ smartgears/dm_pool_manager/tasks/main.yml | 30 ++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 smartgears/dm_pool_manager/defaults/main.yml create mode 100644 smartgears/dm_pool_manager/handlers/main.yml create mode 100644 smartgears/dm_pool_manager/tasks/main.yml diff --git a/smartgears/dm_pool_manager/defaults/main.yml b/smartgears/dm_pool_manager/defaults/main.yml new file mode 100644 index 00000000..27863bc4 --- /dev/null +++ b/smartgears/dm_pool_manager/defaults/main.yml @@ -0,0 +1,10 @@ +--- +dm_pool_manager_install: False +dm_pool_manager_upgrade: False +dm_pool_manager_version: 1.0.0-4.4.0-147199 +dm_pool_manager_name: dataminer-pool-manager + +dm_pool_manager_group_id: org.gcube.dataAnalysis +dm_pool_manager_extension: war +dm_pool_manager_file: '{{ dm_pool_manager_name }}-{{ dm_pool_manager_version }}.{{ dm_pool_manager_extension }}' + diff --git a/smartgears/dm_pool_manager/handlers/main.yml b/smartgears/dm_pool_manager/handlers/main.yml new file mode 100644 index 00000000..a9b4ffdd --- /dev/null +++ b/smartgears/dm_pool_manager/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: Restart smartgears + service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted diff --git a/smartgears/dm_pool_manager/tasks/main.yml b/smartgears/dm_pool_manager/tasks/main.yml new file mode 100644 index 00000000..c31a8709 --- /dev/null +++ b/smartgears/dm_pool_manager/tasks/main.yml @@ -0,0 +1,30 @@ +--- +- block: + - name: Remove the old dm_pool_manager files + file: path={{ smartgears_instance_path }}/webapps/{{ dm_pool_manager_name }} state=absent + when: dm_pool_manager_upgrade + + # NOTE: Install as the smartgears user so we do not mess with the permissions + - name: Get the dm_pool_manager + maven_artifact: artifact_id={{ dm_pool_manager_name }} version={{ dm_pool_manager_version | default(omit) }} group_id={{ dm_pool_manager_group_id }} extension={{ dm_pool_manager_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_user_home }}/{{ dm_pool_manager_file }} + + - name: Create the dm_pool_manager working directory + file: path={{ smartgears_instance_path }}/webapps/{{ dm_pool_manager_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} + + - name: Unarchive the dm_pool_manager war + unarchive: copy=no src={{ smartgears_user_home }}/{{ dm_pool_manager_file }} dest={{ smartgears_instance_path }}/webapps/{{ dm_pool_manager_name }} creates={{ smartgears_instance_path }}/webapps/{{ dm_pool_manager_name }}/WEB-INF/lib + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + when: dm_pool_manager_install + tags: [ 'smartgears', 'dm_pool_manager', 'tomcat' ] + +- block: + - name: Remove the old sdi files + file: path={{ smartgears_instance_path }}/webapps/{{ dm_pool_manager_name }} state=absent + + become: True + become_user: '{{ d4science_user }}' + when: not dm_pool_manager_install + tags: [ 'smartgears', 'dm_pool_manager', 'tomcat' ]