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

32 lines
1.4 KiB
YAML

---
- block:
- name: Remove the old sdi files
file: path={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/{{ sdi_service_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ sdi_service_name }}.{{ sdi_extension }}'
become: True
become_user: '{{ d4science_user }}'
when: not sdi_service_install
tags: [ 'smartgears', 'sdi_service', 'tomcat' ]
- block:
- name: Get the sdi-service
maven_artifact: artifact_id={{ sdi_service_name }} version={{ sdi_service_version | default('latest') }} group_id={{ sdi_group_id }} extension={{ sdi_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ sdi_service_file }}
register: sdi_service_download
- name: Remove the old sdi files
file: path={{ smartgears_instance_path }}/webapps/{{ sdi_service_name }} state=absent
when: ( sdi_service_download | changed )
- name: Copy the sdi service war file into the webapps directory
copy: src={{ smartgears_downloads_dir }}/{{ sdi_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ sdi_service_name }}.{{ sdi_extension }} remote_src=yes force=yes
notify: Restart smartgears
become: True
become_user: '{{ d4science_user }}'
when: sdi_service_install
tags: [ 'smartgears', 'sdi_service', 'tomcat' ]