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

47 lines
2.6 KiB
YAML

---
- block:
- name: Remove the old java_rproxy service files
file: path={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/{{ java_rproxy_service_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ java_rproxy_service_name }}.{{ java_rproxy_service_extension }}'
notify: Restart smartgears
become: True
become_user: '{{ d4science_user }}'
when: not java_rproxy_service_install
tags: [ 'smartgears', 'java_rproxy_service', 'tomcat' ]
- block:
- name: Get the java_rproxy-service war
#maven_artifact: artifact_id={{ java_rproxy_service_name }} version={{ java_rproxy_service_version | default(omit) }} group_id={{ java_rproxy_group_id }} extension={{ java_rproxy_service_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ java_rproxy_service_file }} verify_checksum=always
maven_artifact: artifact_id={{ java_rproxy_service_name }} version={{ java_rproxy_service_version | default(omit) }} group_id={{ java_rproxy_group_id }} extension={{ java_rproxy_service_extension | default('war') }} repository_url={{ smartgears_rproxy_base_url }} dest={{ smartgears_downloads_dir }}/{{ java_rproxy_service_file }} verify_checksum=always
register: java_rproxy_service_download
- name: Remove the old java_rproxy service files
file: path={{ item }} state=absent
with_items:
- '{{ smartgears_instance_path }}/webapps/{{ java_rproxy_service_name }}'
- '{{ smartgears_instance_path }}/webapps/{{ java_rproxy_service_name }}.{{ java_rproxy_service_extension }}'
notify: Restart smartgears
when: java_rproxy_service_download is changed
- name: Create the java_rproxy webapp directory
file: dest={{ smartgears_instance_path }}/webapps/{{ java_rproxy_service_name }} state=directory
when: java_rproxy_service_download is changed
- name: Unarchive the java_rproxy war file
unarchive: copy=no src={{ smartgears_downloads_dir }}/{{ java_rproxy_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ java_rproxy_service_name }}
args:
creates: '{{ smartgears_instance_path }}/webapps/{{ java_rproxy_service_name }}/WEB-INF/web.xml'
notify: Restart smartgears
- name: Install the java_rproxy web.xml template
template: src=web.xml dest={{ smartgears_instance_path }}/webapps/{{ java_rproxy_service_name }}/WEB-INF/web.xml mode=0440
notify: Restart smartgears
become: True
become_user: '{{ d4science_user }}'
when: java_rproxy_service_install
tags: [ 'smartgears', 'java_rproxy_service', 'tomcat' ]