ansible-roles/smartgears/catalogue_ws/tasks/main.yml

33 lines
1.5 KiB
YAML

---
- block:
- name: Remove the old catalogue ws files
file: path={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }}.{{ catalogue_ws_extension }}'
notify: Restart smartgears
become: True
become_user: '{{ d4science_user }}'
when: not catalogue_ws_install
tags: [ 'smartgears', 'catalogue_ws', 'tomcat' ]
- block:
- name: Get the catalogue-ws
maven_artifact: artifact_id={{ catalogue_ws_name }} version={{ catalogue_ws_version | default(omit) }} group_id={{ catalogue_ws_group_id }} extension={{ catalogue_ws_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ catalogue_ws_file }}
register: catalogue_ws_download
- name: Remove the old catalogue ws files
file: path={{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }} state=absent
when: ( catalogue_ws_download | changed )
- name: Copy the catalogue ws war into the tomcat webapps directory
copy: src={{ smartgears_downloads_dir }}/{{ catalogue_ws_file }} dest={{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }}.{{ catalogue_ws_extension }} remote_src=yes force=yes
notify: Restart smartgears
become: True
become_user: '{{ d4science_user }}'
when: catalogue_ws_install
tags: [ 'smartgears', 'catalogue_ws', 'tomcat' ]