quota service: Clean up the role.

This commit is contained in:
Andrea Dell'Amico 2017-10-11 18:14:34 +02:00
parent 9b0e808212
commit 0a9e292f64
2 changed files with 14 additions and 10 deletions

View File

@ -5,5 +5,4 @@ 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 }}'

View File

@ -1,23 +1,28 @@
---
- block:
- name: Remove the old quota service files
file: path={{ smartgears_instance_path }}/webapps/{{ quota_service_name }} state=absent
file: path={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/{{ quota_service_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ quota_service_name }}.{{ quota_service_extension }}'
notify: Restart smartgears
become: True
become_user: '{{ d4science_user }}'
when: ( not quota_service_install ) or ( smartgears_upgrade )
when: not quota_service_install
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 }}
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={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ quota_service_file }}
register: quota_service_download
- 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
- name: Remove the old quota service files
file: path={{ smartgears_instance_path }}/webapps/{{ quota_service_name }} state=absent
when: ( quota_service_download | changed )
- name: Copy the quota_service war to the destination place
copy: src={{ smartgears_downloads_dir }}/{{ quota_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ quota_service_name }}.{{ quota_service_extension }} remote_src=yes force=yes
notify: Restart smartgears
become: True