diff --git a/geoserver/geoserver/tasks/geoserver.yml b/geoserver/geoserver/tasks/geoserver.yml index 295d3261..0b3ff53c 100644 --- a/geoserver/geoserver/tasks/geoserver.yml +++ b/geoserver/geoserver/tasks/geoserver.yml @@ -17,9 +17,16 @@ 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.war validate_certs=False + unarchive: copy=no src={{ geoserver_download_url }} dest={{ geoserver_download_directory }} creates={{ geoserver_download_directory }}/geoserver-{{ geoserver_version }}.war 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 + 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 diff --git a/geoserver/geoserver/tasks/main.yml b/geoserver/geoserver/tasks/main.yml index 7fe126b0..ad9a0b0b 100644 --- a/geoserver/geoserver/tasks/main.yml +++ b/geoserver/geoserver/tasks/main.yml @@ -1,2 +1,2 @@ --- -- include: geoserver.yml +- import_tasks: geoserver.yml