forked from ISTI-ansible-roles/ansible-roles
smartgears distribution: Use maven_artifact to download the distribution file.
This commit is contained in:
parent
93727c8cac
commit
436c7d6829
|
@ -17,9 +17,16 @@ smartgears_downloads_dir: '{{ d4science_user_home }}/downloads'
|
||||||
smartgears_instance_path: '{{ smartgears_user_home }}/tomcat'
|
smartgears_instance_path: '{{ smartgears_user_home }}/tomcat'
|
||||||
smartgears_install_path: '{{ smartgears_user_home }}/SmartGears'
|
smartgears_install_path: '{{ smartgears_user_home }}/SmartGears'
|
||||||
smartgears_distribution_version: 2.1.2-4.6.1-146408
|
smartgears_distribution_version: 2.1.2-4.6.1-146408
|
||||||
smartgears_file: 'smartgears-distribution-{{ smartgears_distribution_version }}.tar.gz'
|
#smartgears_file: 'smartgears-distribution-{{ smartgears_distribution_version }}.tar.gz'
|
||||||
smartgears_global_base_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}'
|
smartgears_global_base_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ gcube_repository }}'
|
||||||
smartgears_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ smartgears_gcube_repository }}/org/gcube/distribution/smartgears-distribution/{{ smartgears_distribution_version }}/{{ smartgears_file }}'
|
#smartgears_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ smartgears_gcube_repository }}/org/gcube/distribution/smartgears-distribution/{{ smartgears_distribution_version }}/{{ smartgears_file }}'
|
||||||
|
smartgears_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ smartgears_gcube_repository }}'
|
||||||
|
|
||||||
|
smartgears_name: smartgears-distribution
|
||||||
|
smartgears_group_id: org.gcube.distribution
|
||||||
|
smartgears_extension: tar.gz
|
||||||
|
smartgears_file: '{{ smartgears_name }}-{{ smartgears_distribution_version }}.{{ smartgears_extension }}'
|
||||||
|
|
||||||
smartgears_mode: online
|
smartgears_mode: online
|
||||||
smartgears_application_mode: online
|
smartgears_application_mode: online
|
||||||
# Production infra
|
# Production infra
|
||||||
|
|
|
@ -6,25 +6,35 @@
|
||||||
- name: Remove the smartgears distribution archive to force un upgrade
|
- name: Remove the smartgears distribution archive to force un upgrade
|
||||||
file: dest={{ item }} state=absent
|
file: dest={{ item }} state=absent
|
||||||
with_items:
|
with_items:
|
||||||
- '{{ smartgears_user_home }}/{{ smartgears_file }}'
|
- '{{ smartgears_downloads_dir }}/{{ smartgears_file }}'
|
||||||
- '{{ smartgears_user_home }}/smartgears-distribution-{{ smartgears_distribution_version }}'
|
- '{{ smartgears_user_home }}/smartgears-distribution-{{ smartgears_distribution_version }}'
|
||||||
when: smartgears_force_install
|
when: smartgears_force_install
|
||||||
tags: [ 'smartgears', 'tomcat' ]
|
tags: [ 'smartgears', 'tomcat' ]
|
||||||
|
|
||||||
|
- name: Get the smartgears distribution
|
||||||
|
become: True
|
||||||
|
become_user: '{{ smartgears_user }}'
|
||||||
|
maven_artifact: artifact_id={{ smartgears_name }} version={{ smartgears_distribution_version | default('latest') }} group_id={{ smartgears_group_id }} extension={{ smartgears_extension | default('tar.gz') }} repository_url={{ smartgears_url }} dest={{ smartgears_downloads_dir }}/{{ smartgears_file }}
|
||||||
|
with_items: '{{ tomcat_m_instances }}'
|
||||||
|
register: smartgears_download
|
||||||
|
when: not item.skip_smartgears
|
||||||
|
tags: [ 'smartgears', 'tomcat' ]
|
||||||
|
|
||||||
- name: Unarchive the smartgears distribution
|
- name: Unarchive the smartgears distribution
|
||||||
become: True
|
become: True
|
||||||
become_user: '{{ smartgears_user }}'
|
become_user: '{{ smartgears_user }}'
|
||||||
unarchive: copy=no src={{ smartgears_url }} dest={{ smartgears_user_home }} creates={{ smartgears_user_home }}/smartgears-distribution-{{ smartgears_distribution_version }}
|
unarchive: remote_src=yes src={{ smartgears_downloads_dir }}/{{ smartgears_file }} dest={{ smartgears_user_home }}
|
||||||
register: new_smartgears_distribution
|
|
||||||
with_items: '{{ tomcat_m_instances }}'
|
with_items: '{{ tomcat_m_instances }}'
|
||||||
when: not item.skip_smartgears
|
when:
|
||||||
|
- not item.skip_smartgears
|
||||||
|
- ( smartgears_download | changed )
|
||||||
tags: [ 'smartgears', 'tomcat' ]
|
tags: [ 'smartgears', 'tomcat' ]
|
||||||
|
|
||||||
- name: Stop the smartgears container before launching the upgrade script
|
- name: Stop the smartgears container before launching the upgrade script
|
||||||
become: True
|
become: True
|
||||||
become_user: '{{ smartgears_user }}'
|
become_user: '{{ smartgears_user }}'
|
||||||
shell: /home/{{ smartgears_user }}/stopContainer.sh
|
shell: /home/{{ smartgears_user }}/stopContainer.sh
|
||||||
when: smartgears_upgrade
|
when: smartgears_upgrade or ( smartgears_download | changed )
|
||||||
tags: [ 'smartgears', 'tomcat', 'stop_smartgears_service' ]
|
tags: [ 'smartgears', 'tomcat', 'stop_smartgears_service' ]
|
||||||
|
|
||||||
- name: Install the additional tomcat default file
|
- name: Install the additional tomcat default file
|
||||||
|
@ -46,7 +56,7 @@
|
||||||
shell: cd {{ item.user_home }}/smartgears-distribution-{{ smartgears_distribution_version }} ; . /{{ item.user_home }}/.bashrc ; ./install -s tomcat ; chown -R gcube:gcube '{{ item.user_home }}/smartgears-distribution-{{ smartgears_distribution_version }}' '{{ item.user_home }}/SmartGears/' '{{ item.user_home }}/tomcat/lib/' '{{ item.user_home }}/tomcat/webapps/'
|
shell: cd {{ item.user_home }}/smartgears-distribution-{{ smartgears_distribution_version }} ; . /{{ item.user_home }}/.bashrc ; ./install -s tomcat ; chown -R gcube:gcube '{{ item.user_home }}/smartgears-distribution-{{ smartgears_distribution_version }}' '{{ item.user_home }}/SmartGears/' '{{ item.user_home }}/tomcat/lib/' '{{ item.user_home }}/tomcat/webapps/'
|
||||||
with_items: '{{ tomcat_m_instances }}'
|
with_items: '{{ tomcat_m_instances }}'
|
||||||
when:
|
when:
|
||||||
- ( new_smartgears_distribution | changed )
|
- ( smartgears_download | changed )
|
||||||
- not item.skip_smartgears
|
- not item.skip_smartgears
|
||||||
register: install_smartgears_app
|
register: install_smartgears_app
|
||||||
notify: Restart smartgears
|
notify: Restart smartgears
|
||||||
|
|
Loading…
Reference in New Issue