library/roles/smartgears/social-networking-library-ws: role that installs the social-networking service.

This commit is contained in:
Andrea Dell'Amico 2017-03-08 14:47:38 +01:00
parent a9ee8fa889
commit b56a2549e5
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,9 @@
---
social_networking_library_ws_install: False
social_networking_library_ws_version: 2.0.0-4.3.0-144413
social_networking_library_ws_name: social-networking-library-ws
social_networking_library_ws_group_id: org.gcube.portal
social_networking_library_ws_extension: war
social_networking_library_ws_file: '{{ social_networking_library_ws_name }}-{{ social_networking_library_ws_version }}.{{ social_networking_library_ws_extension }}'
social_networking_library_ws_repository_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}'

View File

@ -0,0 +1,26 @@
---
- block:
- name: Remove the old social-networking-library-ws files
file: path={{ smartgears_instance_path }}/webapps/{{ social_networking_library_ws_name }} state=absent
become: True
become_user: '{{ d4science_user }}'
when: ( not social_networking_library_ws_install ) or ( smartgears_upgrade )
tags: [ 'smartgears', 'social_networking_library_ws', 'tomcat' ]
- block:
# NOTE: Install as the smartgears user so we do not mess with the permissions
- name: Get the social-networking-library-ws war
maven_artifact: artifact_id={{ social_networking_library_ws_name }} version={{ social_networking_library_ws_version | default(omit) }} group_id={{ social_networking_library_ws_group_id }} extension={{ social_networking_library_ws_extension | default('war') }} repository_url={{ social_networking_library_ws_repository_url }} dest={{ smartgears_user_home }}/{{ social_networking_library_ws_file }}
- name: Create the data trasfer working directory
file: path={{ smartgears_instance_path }}/webapps/{{ social_networking_library_ws_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
- name: Unarchive the social_networking_library_ws war
unarchive: copy=no src={{ smartgears_user_home }}/{{ social_networking_library_ws_file }} dest={{ smartgears_instance_path }}/webapps/{{ social_networking_library_ws_name }} creates={{ smartgears_instance_path }}/webapps/{{ social_networking_library_ws_name }}/WEB-INF/lib
notify: Restart smartgears
become: True
become_user: '{{ d4science_user }}'
when: social_networking_library_ws_install
tags: [ 'smartgears', 'social_networking_library_ws', 'tomcat' ]