Merge branch 'master' of gitorious.research-infrastructures.eu:infrastructure-management/ansible-playbooks

This commit is contained in:
Roberto Cirillo 2018-01-25 16:28:37 +01:00
commit 2ea02e13ad
6 changed files with 45 additions and 14 deletions

View File

@ -6,7 +6,11 @@ cmems_importer_se_plugin_version: latest
cmems_importer_se_plugin_group_id: 'org.gcube.dataanalysis'
cmems_importer_se_plugin_name: 'cmems-importer-se-plugin'
cmems_importer_se_plugin_extension: 'jar'
cmems_importer_se_plugin_classifier: 'jar-with-dependencies'
cmems_importer_se_plugin_file: '{{ cmems_importer_se_plugin_name }}-{{ cmems_importer_se_plugin_version }}-jar-with-dependencies.{{ cmems_importer_se_plugin_extension }}'
cmems_importer_se_plugin_classifier: 'uberjar'
cmems_importer_se_plugin_uber_file: '{{ cmems_importer_se_plugin_name }}-{{ cmems_importer_se_plugin_version }}-{{ cmems_importer_se_plugin_classifier }}.{{ cmems_importer_se_plugin_extension }}'
cmems_importer_se_plugin_file: '{{ cmems_importer_se_plugin_name }}-{{ cmems_importer_se_plugin_version }}.{{ cmems_importer_se_plugin_extension }}'
catalina_apps_conf:
- { app_name: '{{ smart_executor_name }}', plugin_name: '{{ cmems_importer_se_plugin_name }}' }
# Note: the deb package nco is required

View File

@ -0,0 +1,5 @@
---
dependencies:
- role: '../library/roles/smartgears/smart_executor'
- role: '../library/roles/smartgears/catalina-app-conf'

View File

@ -1,7 +1,7 @@
---
- block:
- name: Remove the old cmems-importer plugin
shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ cmems_importer_se_plugin_name }}-*-{{ cmems_importer_se_plugin_classifier }}.{{ cmems_importer_se_plugin_extension }}
- 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
@ -11,18 +11,33 @@
- block:
- name: Download the cmems-importer plugin
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_file }}
- 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 plugin
shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ cmems_importer_se_plugin_name }}-*-{{ cmems_importer_se_plugin_classifier }}.{{ cmems_importer_se_plugin_extension }}
- 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 | changed )
notify: Restart smartgears
- name: Copy the cmems-importer plugin on the correct place
copy: src={{ smartgears_downloads_dir }}/{{ cmems_importer_se_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ cmems_importer_se_plugin_file }} remote_src=yes force=yes
when: ( cmems_importer_download | changed )
- 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 | 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

View File

@ -0,0 +1,3 @@
---
smart_executor_install: True

View File

@ -9,7 +9,7 @@
tags: [ 'smartgears', 'sis_geotk', 'tomcat' ]
- block:
- name: Get the Sis geotk data transfer uber plugin
- name: Get the Sis geotk data transfer uber jar
maven_artifact: artifact_id={{ sis_geotk_dt_plugin_name }} version={{ sis_geotk_dt_plugin_version }} group_id={{ sis_geotk_dt_plugin_group_id }} extension={{ sis_geotk_dt_plugin_extension }} repository_url={{ smartgears_global_base_url }} classifier={{ sis_geotk_dt_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ sis_geotk_dt_plugin_uber_file }}
register: sis_geotk_download
@ -21,13 +21,14 @@
file: dest={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/lib/plugins/{{ sis_geotk_dt_plugin_name }} state=directory
register: sis_geotk_create_dir
- name: Unarchive the Sis geotk data transfer uber plugin to expose its libraries
- name: Unarchive the Sis geotk data transfer uber jar to expose its libraries
unarchive: src={{ smartgears_downloads_dir }}/{{ sis_geotk_dt_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/lib/plugins/{{ sis_geotk_dt_plugin_name }}/ copy=no
when: (sis_geotk_create_dir | changed)
notify: Restart smartgears
- name: Get the Sis geotk data transfer uber plugin
- name: Get the Sis geotk data transfer jar
maven_artifact: artifact_id={{ sis_geotk_dt_plugin_name }} version={{ sis_geotk_dt_plugin_version }} group_id={{ sis_geotk_dt_plugin_group_id }} extension={{ sis_geotk_dt_plugin_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/lib/plugins/{{ sis_geotk_dt_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/{{ data_trasfer_service_name }}/WEB-INF/lib/plugins/{{ sis_geotk_dt_plugin_name }}/{{ item }} state=absent

View File

@ -0,0 +1,3 @@
---
#data_transfer_service_install: True