From 693a6aeebb4008a00dabaaef356553cd17588421 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 19 Apr 2019 14:46:53 +0200 Subject: [PATCH] adde tasks for new gfeed plugin --- .../tasks/main.yml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 smartgears/dataminer_algorithms_crawler_plugin/tasks/main.yml diff --git a/smartgears/dataminer_algorithms_crawler_plugin/tasks/main.yml b/smartgears/dataminer_algorithms_crawler_plugin/tasks/main.yml new file mode 100644 index 00000000..3091b5bc --- /dev/null +++ b/smartgears/dataminer_algorithms_crawler_plugin/tasks/main.yml @@ -0,0 +1,44 @@ +--- +- block: + - name: Remove the old dataminer crawler gfeed plugin + file: dest={{ smartgears_instance_path }}/webapps/{{ gfeed_service_name }}/WEB-INF/lib/plugins/{{ dataminer_crawler_plugin_plugin_name }} state=absent + + become: True + become_user: '{{ smartgears_user }}' + when: not dataminer_crawler_plugin_plugin_install + tags: [ 'smartgears', 'dataminer_crawler', 'tomcat' ] + +- block: + - name: Get the dataminer crawler gfeed uber jar + maven_artifact: artifact_id={{ dataminer_crawler_plugin_plugin_name }} version={{ dataminer_crawler_plugin_plugin_version }} group_id={{ dataminer_crawler_plugin_plugin_group_id }} extension={{ dataminer_crawler_plugin_plugin_extension }} repository_url={{ smartgears_global_base_url }} classifier={{ dataminer_crawler_plugin_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ dataminer_crawler_plugin_plugin_uber_file }} verify_checksum=always + register: dataminer_crawler_download + + - name: Remove the old dataminer crawler gfeed plugin + file: dest={{ smartgears_instance_path }}/webapps/{{ gfeed_service_name }}/WEB-INF/lib/plugins/{{ dataminer_crawler_plugin_plugin_name }} state=absent + when: dataminer_crawler_download is changed + + - name: Create the plugin directory inside gfeed + file: dest={{ smartgears_instance_path }}/webapps/{{ gfeed_service_name }}/WEB-INF/lib/plugins/{{ dataminer_crawler_plugin_plugin_name }} state=directory + register: dataminer_crawler_create_dir + + - name: Unarchive the dataminer crawler gfeed uber jar to expose its libraries + unarchive: src={{ smartgears_downloads_dir }}/{{ dataminer_crawler_plugin_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ gfeed_service_name }}/WEB-INF/lib/plugins/{{ dataminer_crawler_plugin_plugin_name }}/ copy=no + when: dataminer_crawler_create_dir is changed + notify: Restart smartgears + + - name: Get the dataminer crawler gfeed jar + maven_artifact: artifact_id={{ dataminer_crawler_plugin_plugin_name }} version={{ dataminer_crawler_plugin_plugin_version }} group_id={{ dataminer_crawler_plugin_plugin_group_id }} extension={{ dataminer_crawler_plugin_plugin_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_instance_path }}/webapps/{{ gfeed_service_name }}/WEB-INF/lib/plugins/{{ dataminer_crawler_plugin_plugin_name }} keep_name=yes + notify: Restart smartgears + + - name: Remove the dataminer crawler uber jar org and META-INF directories + file: dest={{ smartgears_instance_path }}/webapps/{{ gfeed_service_name }}/WEB-INF/lib/plugins/{{ dataminer_crawler_plugin_plugin_name }}/{{ item }} state=absent + with_items: + - org + - 'META-INF' + notify: Restart smartgears + + become: True + become_user: '{{ smartgears_user }}' + when: dataminer_crawler_plugin_plugin_install + tags: [ 'smartgears', 'dataminer_crawler', 'tomcat' ] +