geoserver role: fix the upgrade scenario.

This commit is contained in:
Andrea Dell'Amico 2018-03-19 20:10:05 +01:00
parent 188f0ccb8a
commit 538b05abb2
1 changed files with 18 additions and 5 deletions

View File

@ -17,16 +17,29 @@
with_items: '{{ tomcat_m_instances }}'
- name: Download the Geoserver file distribution
unarchive: copy=no src={{ geoserver_download_url }} dest={{ geoserver_download_directory }} creates={{ geoserver_download_directory }}/geoserver-{{ geoserver_version }}.war validate_certs=False
get_url: url={{ geoserver_download_url }} dest={{ geoserver_download_directory }} validate_certs=False
register: geoserver_download
- name: Remove the old geoserver instance if there's any
file: dest=dest={{ item.instance_path }}/webapps/{{ geoserver_app_name | lower }} state=absent
- name: Remove the old geoserver war files
file: dest={{ geoserver_download_directory }}/{{ item }} state=absent
with_items:
- geoserver.war
- target
when: geoserver_download is changed
- name: Unpack the Geoserver zip file
unarchive: copy=no src={{ geoserver_download_directory }}/geoserver-{{ geoserver_version }}-war.zip dest={{ geoserver_download_directory }} creates={{ geoserver_download_directory }}/geoserver.war
- name: Remove the old geoserver instance if it is present
file: dest={{ item.instance_path }}/webapps/{{ geoserver_app_name | lower }} state=absent
with_items: '{{ tomcat_m_instances }}'
when: geoserver_download is changed
- name: Create the Geoserver webapp directory
file: path={{ item.instance_path }}/webapps/{{ geoserver_app_name | lower }} state=directory owner={{ item.user }} group={{ item.user }}
with_items: '{{ tomcat_m_instances }}'
when: ( geoserver_download | changed )
- name: Unpack the Geoserver war file
#unarchive: copy=no src={{ geoserver_download_directory }}/geoserver-{{ geoserver_version }}.war dest={{ item.instance_path }}/webapps/{{ geoserver_app_name | lower }} creates={{ item.instance_path }}/webapps/{{ geoserver_app_name | lower }}/WEB-INF/lib owner={{ item.user }} group={{ item.user }}
unarchive: copy=no src={{ geoserver_download_directory }}/geoserver.war dest={{ item.instance_path }}/webapps/{{ geoserver_app_name | lower }} creates={{ item.instance_path }}/webapps/{{ geoserver_app_name | lower }}/WEB-INF/lib owner={{ item.user }} group={{ item.user }}
with_items: '{{ tomcat_m_instances }}'
notify: tomcat instances restart