diff --git a/smartgears/social-networking-library-ws/defaults/main.yml b/smartgears/social-networking-library-ws/defaults/main.yml new file mode 100644 index 00000000..42fc269b --- /dev/null +++ b/smartgears/social-networking-library-ws/defaults/main.yml @@ -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 }}' + diff --git a/smartgears/social-networking-library-ws/tasks/main.yml b/smartgears/social-networking-library-ws/tasks/main.yml new file mode 100644 index 00000000..dac5fab3 --- /dev/null +++ b/smartgears/social-networking-library-ws/tasks/main.yml @@ -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' ]