From 345b127e409591f01469af56487530921126df3b Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Tue, 30 Apr 2019 09:49:39 +0200 Subject: [PATCH] added new tasks --- smartgears/ws_explorer_app/tasks/main.yml | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 smartgears/ws_explorer_app/tasks/main.yml diff --git a/smartgears/ws_explorer_app/tasks/main.yml b/smartgears/ws_explorer_app/tasks/main.yml new file mode 100644 index 0000000..2d6f39f --- /dev/null +++ b/smartgears/ws_explorer_app/tasks/main.yml @@ -0,0 +1,31 @@ +--- +- block: + - name: Remove the old files + file: path={{ item }} state=absent + with_items: + - '{{ smartgears_instance_path }}/webapps/{{ ws_explorer_name }}' + - '{{ smartgears_instance_path }}/webapps/{{ ws_explorer_name }}.{{ ws_explorer_extension }}' + + become: True + become_user: '{{ d4science_user }}' + when: not ws_explorer_install + tags: [ 'smartgears', 'ws_explorer', 'tomcat' ] + +- block: + - name: Get the ws explorer app + maven_artifact: artifact_id={{ ws_explorer_name }} version={{ ws_explorer_version | default('latest') }} group_id={{ ws_explorer_group_id }} extension={{ ws_explorer_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ ws_explorer_file }} verify_checksum=always + register: ws_explorer_download + + - name: Remove the old ws explorer + file: path={{ smartgears_instance_path }}/webapps/{{ ws_explorer_name }} state=absent + when: ws_explorer_download is changed + + - name: Copy the ws explorer war file into the webapps directory + copy: src={{ smartgears_downloads_dir }}/{{ ws_explorer_file }} dest={{ smartgears_instance_path }}/webapps/{{ ws_explorer_name }}.{{ ws_explorer_extension }} remote_src=yes force=yes + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + when: ws_explorer_install + tags: [ 'smartgears', 'ws_explorer', 'tomcat' ] +