From 5e24ea56abcf14decf0221f8f72addbd143451d8 Mon Sep 17 00:00:00 2001 From: Roberto Date: Fri, 24 Feb 2017 15:58:41 +0100 Subject: [PATCH] moved grsf_publisher_ws from gcube role to smartgears role add quota service roles update smartgears-node* files --- .../grsf_publisher_ws/defaults/main.yml | 0 .../grsf_publisher_ws/handlers/main.yml | 0 .../grsf_publisher_ws/tasks/main.yml | 0 smartgears/quota_service/defaults/main.yml | 9 +++++++ smartgears/quota_service/tasks/main.yml | 26 +++++++++++++++++++ 5 files changed, 35 insertions(+) rename {gcube => smartgears}/grsf_publisher_ws/defaults/main.yml (100%) rename {gcube => smartgears}/grsf_publisher_ws/handlers/main.yml (100%) rename {gcube => smartgears}/grsf_publisher_ws/tasks/main.yml (100%) create mode 100644 smartgears/quota_service/defaults/main.yml create mode 100644 smartgears/quota_service/tasks/main.yml diff --git a/gcube/grsf_publisher_ws/defaults/main.yml b/smartgears/grsf_publisher_ws/defaults/main.yml similarity index 100% rename from gcube/grsf_publisher_ws/defaults/main.yml rename to smartgears/grsf_publisher_ws/defaults/main.yml diff --git a/gcube/grsf_publisher_ws/handlers/main.yml b/smartgears/grsf_publisher_ws/handlers/main.yml similarity index 100% rename from gcube/grsf_publisher_ws/handlers/main.yml rename to smartgears/grsf_publisher_ws/handlers/main.yml diff --git a/gcube/grsf_publisher_ws/tasks/main.yml b/smartgears/grsf_publisher_ws/tasks/main.yml similarity index 100% rename from gcube/grsf_publisher_ws/tasks/main.yml rename to smartgears/grsf_publisher_ws/tasks/main.yml diff --git a/smartgears/quota_service/defaults/main.yml b/smartgears/quota_service/defaults/main.yml new file mode 100644 index 0000000..d760689 --- /dev/null +++ b/smartgears/quota_service/defaults/main.yml @@ -0,0 +1,9 @@ +--- +quota_service_install: False +quota_service_version: latest +quota_service_name: quota-manager +quota_group_id: org.gcube.resource.management +quota_extension: war +quota_service_file: '{{ quota_service_name }}-{{ quota_service_version }}.{{ quota_extension }}' +quota_service_repository_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}' + diff --git a/smartgears/quota_service/tasks/main.yml b/smartgears/quota_service/tasks/main.yml new file mode 100644 index 0000000..f425270 --- /dev/null +++ b/smartgears/quota_service/tasks/main.yml @@ -0,0 +1,26 @@ +--- +- block: + - name: Remove the old quota service files + file: path={{ smartgears_instance_path }}/webapps/{{ quota_service_name }} state=absent + + become: True + become_user: '{{ d4science_user }}' + when: ( not quota_service_install ) or ( smartgears_upgrade ) + tags: [ 'smartgears', 'quota_service', 'tomcat' ] + +- block: + # NOTE: Install as the smartgears user so we do not mess with the permissions + - name: Get the quota-service war + maven_artifact: artifact_id={{ quota_service_name }} version={{ quota_service_version | default(omit) }} group_id={{ quota_group_id }} extension={{ quota_extension | default('war') }} repository_url={{ quota_service_repository_url }} dest={{ smartgears_user_home }}/{{ quota_service_file }} + + - name: Create the quota manager working directory + file: path={{ smartgears_instance_path }}/webapps/{{ quota_service_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} + + - name: Unarchive the quota_service war + unarchive: copy=no src={{ smartgears_user_home }}/{{ quota_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ quota_service_name }} creates={{ smartgears_instance_path }}/webapps/{{ quota_service_name }}/WEB-INF/lib + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + when: quota_service_install + tags: [ 'smartgears', 'quota_service', 'tomcat' ]