library/roles/smartgears/accounting-service: Converto the accounting-service role to maven_artifact.

This commit is contained in:
Andrea Dell'Amico 2017-06-12 17:46:09 +02:00
parent a990b8f6a8
commit dfcc84773c
2 changed files with 16 additions and 15 deletions

View File

@ -1,10 +1,8 @@
---
accounting_service_gcube_repository: 'gcube-staging'
accounting_service_install: False
accounting_service_ver: 1.0.0-4.5.0-148495
accounting_service_snap: 1.0.0-SNAPSHOT
accounting_service_upgrade: False
accounting_service_version: 1.0.0-4.5.0-148495
accounting_service_name: accounting-service
accounting_service_filename: '{{ accounting_service_name }}-{{ accounting_service_ver }}.war'
accounting_service_url: 'http://maven.research-infrastructures.eu/nexus/service/local/repositories/{{ accounting_service_gcube_repository }}/content/org/gcube/data/publishing/{{ accounting_service_name }}/{{ accounting_service_ver}}/{{ accounting_service_filename }}'
accounting_service_war_file: '{{ accounting_service_name }}.war'
accounting_service_extension: war
accounting_service_file: '{{ accounting_service_name }}-{{ accounting_service_version }}.{{ accounting_service_extension }}'
accounting_service_group_id: org.gcube.data.publishing

View File

@ -1,15 +1,18 @@
---
- block:
- name: Remove the old accounting-service files
file: path={{ smartgears_instance_path }}/webapps/{{ accounting_service_name }} state=absent
when: accounting_service_upgrade
- name: Remove the installed accounting-service before upgrading
file: dest={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/accounting-service'
- '{{ smartgears_instance_path }}/webapps/accounting-service.war'
when: smartgears_upgrade
- name: Create the accounting-service working directory
file: path={{ smartgears_instance_path }}/webapps/{{ accounting_service_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
- name: Get the accounting_service war
maven_artifact: artifact_id={{ accounting_service_name }} version={{ accounting_service_version | default('latest') }} group_id={{ accounting_service_group_id }} extension={{ accounting_service_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_user_home }}/{{ accounting_service_file }}
- name: Get the accounting-service war file
get_url: url={{ accounting_service_url }} dest={{ smartgears_instance_path }}/webapps/{{ accounting_service_war_file }}
- name: Unarchive the accounting service war
unarchive: copy=no src={{ smartgears_user_home }}/{{ accounting_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ accounting_service_name }} creates={{ smartgears_instance_path }}/webapps/{{ accounting_service_name }}/WEB-INF/lib
notify: Restart smartgears
become: True
become_user: '{{ smartgears_user }}'