From e59adb1c2adc56c45c82f1475029d81470ae8c0d Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Tue, 30 Apr 2019 09:49:22 +0200 Subject: [PATCH] added new tasks --- smartgears/transect/tasks/main.yml | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 smartgears/transect/tasks/main.yml diff --git a/smartgears/transect/tasks/main.yml b/smartgears/transect/tasks/main.yml new file mode 100644 index 0000000..c7b767d --- /dev/null +++ b/smartgears/transect/tasks/main.yml @@ -0,0 +1,31 @@ +--- +- block: + - name: Remove the old transect files + file: path={{ item }} state=absent + with_items: + - '{{ smartgears_instance_path }}/webapps/{{ transect_name }}' + - '{{ smartgears_instance_path }}/webapps/{{ transect_name }}.{{ transect_extension }}' + + become: True + become_user: '{{ d4science_user }}' + when: not transect_install + tags: [ 'smartgears', 'transect', 'tomcat' ] + +- block: + - name: Get the transect-service + maven_artifact: artifact_id={{ transect_name }} version={{ transect_version | default('latest') }} group_id={{ transect_group_id }} extension={{ sdi_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ transect_file }} verify_checksum=always + register: transect_download + + - name: Remove the old transect files + file: path={{ smartgears_instance_path }}/webapps/{{ transect_name }} state=absent + when: transect_download is changed + + - name: Copy the transect service war file into the webapps directory + copy: src={{ smartgears_downloads_dir }}/{{ transect_file }} dest={{ smartgears_instance_path }}/webapps/{{ transect_name }}.{{ transect_extension }} remote_src=yes force=yes + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + when: transect_install + tags: [ 'smartgears', 'transect', 'tomcat' ] +