../library/roles/smartgears/accounting_aggregator_se_plugin add new role for uber-jar

group_vars/accounting_aggregator_se_plugin_dev/accounting_aggregator_se_plugin_dev.yml removed unused variables
group_vars/accounting_aggregator_se_plugin_prod/accounting_aggregator_se_plugin_prod.yml removed/commented unused variables
inventory/hosts.dev commented is-exporter plugin from smartexecutor1-d-d4s instance
This commit is contained in:
Roberto Cirillo 2018-02-14 16:37:56 +01:00
parent 2f2a58dcce
commit bdbd824131
2 changed files with 44 additions and 18 deletions

View File

@ -1,11 +1,16 @@
--- ---
accounting_aggregator_se_plugin_install: False accounting_aggregator_se_plugin_install: False
accounting_aggregator_se_plugin_upgrade: False
accounting_aggregator_se_plugin_version: latest
accounting_aggregator_se_plugin_group_id: 'org.gcube.accounting'
accounting_aggregator_se_plugin_name: 'accounting-aggregator-se-plugin' accounting_aggregator_se_plugin_name: 'accounting-aggregator-se-plugin'
accounting_aggregator_se_plugin_group_id : 'org.gcube.accounting'
accounting_aggregator_se_plugin_artifact_id : 'accounting-aggregator-se-plugin'
accounting_aggregator_se_plugin_version : '1.0.0-SNAPSHOT'
accounting_aggregator_se_plugin_extension: 'jar' accounting_aggregator_se_plugin_extension: 'jar'
accounting_aggregator_se_plugin_classifier: 'jar-with-dependencies' accounting_aggregator_se_plugin_classifier: 'uberjar'
accounting_aggregator_se_plugin_file: '{{ accounting_aggregator_se_plugin_name }}-{{ accounting_aggregator_se_plugin_version }}-jar-with-dependencies.{{ accounting_aggregator_se_plugin_extension }}' accounting_aggregator_se_plugin_uber_file: '{{ accounting_aggregator_se_plugin_name }}-{{ accounting_aggregator_se_plugin_version }}-{{ accounting_aggregator_se_plugin_classifier }}.{{ accounting_aggregator_se_plugin_extension }}'
accounting_aggregator_se_plugin_file: '{{ accounting_aggregator_se_plugin_name }}-{{ accounting_aggregator_se_plugin_version }}.{{ accounting_aggregator_se_plugin_extension }}'
catalina_apps_conf:
- { app_name: '{{ smart_executor_name }}', plugin_name: '{{ accounting_aggregator_se_plugin_name }}' }
# Note: the deb package nco is required

View File

@ -1,7 +1,7 @@
--- ---
- block: - block:
- name: Remove the old accounting aggregator plugin - name: Remove the accounting_aggregator smart executor plugin
shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/accounting-aggregator-se-plugin-*-jar-with-dependencies.jar file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_aggregator_se_plugin_name }} state=absent
notify: Restart smartgears notify: Restart smartgears
become: True become: True
@ -9,21 +9,42 @@
when: not accounting_aggregator_se_plugin_install when: not accounting_aggregator_se_plugin_install
tags: [ 'smartgears', 'accounting_aggregator_se', 'tomcat' ] tags: [ 'smartgears', 'accounting_aggregator_se', 'tomcat' ]
- block: - block:
- name: Get the accounting aggregator plugin and install it inside the smart executor - name: Download the accounting_aggregator plugin uber jar
maven_artifact: artifact_id={{ accounting_aggregator_se_plugin_name }} version={{ accounting_aggregator_se_plugin_version | default(omit) }} group_id={{ accounting_aggregator_se_plugin_group_id }} extension={{ accounting_aggregator_se_plugin_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ accounting_aggregator_se_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ accounting_aggregator_se_plugin_file }} maven_artifact: artifact_id={{ accounting_aggregator_se_plugin_name }} version={{ accounting_aggregator_se_plugin_version | default('latest') }} group_id={{ accounting_aggregator_se_plugin_group_id }} extension={{ accounting_aggregator_se_plugin_extension }} repository_url={{ smartgears_global_base_url }} classifier={{ accounting_aggregator_se_plugin_classifier }} dest={{ smartgears_downloads_dir }}/{{ accounting_aggregator_se_plugin_uber_file }}
register: accounting_aggregator_download register: accounting_aggregator_download
- name: Remove the old accounting aggregator plugin - name: Remove the old accounting_aggregator smart executor plugin
shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/accounting-aggregator-se-plugin-*-jar-with-dependencies.jar file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_aggregator_se_plugin_name }} state=absent
when: (accounting_aggregator_download | changed) when: ( accounting_aggregator_download | changed )
- name: Copy the accounting aggregator plugin to its final destination
copy: src={{ smartgears_downloads_dir }}/{{ accounting_aggregator_se_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ accounting_aggregator_se_plugin_file }} remote_src=yes force=yes
notify: Restart smartgears 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/{{ accounting_aggregator_se_plugin_name }} state=directory
register: accounting_aggregator_create_dir
- name: Unarchive the accounting_aggregator uber jar to expose its libraries
unarchive: src={{ smartgears_downloads_dir }}/{{ accounting_aggregator_se_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_aggregator_se_plugin_name }}/ copy=no
when: (accounting_aggregator_create_dir | changed)
notify: Restart smartgears
- name: Download the accounting_aggregator plugin jar file
maven_artifact: artifact_id={{ accounting_aggregator_se_plugin_name }} version={{ accounting_aggregator_se_plugin_version }} group_id={{ accounting_aggregator_se_plugin_group_id }} extension={{ accounting_aggregator_se_plugin_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_aggregator_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/{{ accounting_aggregator_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: True
become_user: '{{ smartgears_user }}' become_user: '{{ smartgears_user }}'
when: accounting_aggregator_se_plugin_install when: accounting_aggregator_se_plugin_install
tags: [ 'smartgears', 'accounting_aggregator_se', 'tomcat' ] tags: [ 'smartgears', 'accounting_aggregator_se', 'tomcat' ]