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

51 lines
2.9 KiB
YAML

---
- block:
- name: Remove the cmems-importer smart executor plugin
file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ cmems_importer_se_plugin_name }} state=absent
notify: Restart smartgears
become: True
become_user: '{{ smartgears_user }}'
when: not cmems_importer_se_plugin_install
tags: [ 'smartgears', 'cmems_importer_se', 'tomcat' ]
- block:
- name: Download the cmems-importer plugin uber jar
maven_artifact: artifact_id={{ cmems_importer_se_plugin_name }} version={{ cmems_importer_se_plugin_version | default('latest') }} group_id={{ cmems_importer_se_plugin_group_id }} extension={{ cmems_importer_se_plugin_extension }} repository_url={{ smartgears_global_base_url }} classifier={{ cmems_importer_se_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ cmems_importer_se_plugin_uber_file }}
register: cmems_importer_download
- name: Remove the old cmems-importer smart executor plugin
file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ cmems_importer_se_plugin_name }} state=absent
when: cmems_importer_download is changed
notify: Restart smartgears
- name: Create the plugin directory inside the smart executor
file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ cmems_importer_se_plugin_name }} state=directory
register: cmems_importer_create_dir
- name: Unarchive the cmems-importer uber jar to expose its libraries
unarchive: src={{ smartgears_downloads_dir }}/{{ cmems_importer_se_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ cmems_importer_se_plugin_name }}/ copy=no
when: cmems_importer_create_dir is changed
notify: Restart smartgears
- name: Download the cmems-importer plugin jar file
maven_artifact: artifact_id={{ cmems_importer_se_plugin_name }} version={{ cmems_importer_se_plugin_version }} group_id={{ cmems_importer_se_plugin_group_id }} extension={{ cmems_importer_se_plugin_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ cmems_importer_se_plugin_name }} keep_name=yes
notify: Restart smartgears
- name: Remove the Sis geotk uber jar org and META-INF directories
file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ cmems_importer_se_plugin_name }}/{{ item }} state=absent
with_items:
- org
- 'META-INF'
notify: Restart smartgears
- name: Install the nco package
become_user: root
apt: pkg=nco state=present update_cache=yes cache_valid_time=1800
become: True
become_user: '{{ smartgears_user }}'
when: cmems_importer_se_plugin_install
tags: [ 'smartgears', 'cmems_importer_se', 'tomcat' ]