From 430fe78896fe28953fe9f28fa339bc60ce9bec07 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 23 Nov 2016 19:18:56 +0100 Subject: [PATCH] library/roles/geoserver: First tasks for the installation of a Geoserver, and its spatialite extension. --- geoserver/geoserver/defaults/main.yml | 10 +++++++ geoserver/geoserver/tasks/main.yml | 39 ++++++++++++++++++++++++++ geoserver/spatialite/defaults/main.yml | 10 +++++++ 3 files changed, 59 insertions(+) create mode 100644 geoserver/geoserver/defaults/main.yml create mode 100644 geoserver/geoserver/tasks/main.yml create mode 100644 geoserver/spatialite/defaults/main.yml diff --git a/geoserver/geoserver/defaults/main.yml b/geoserver/geoserver/defaults/main.yml new file mode 100644 index 00000000..c5fec9d2 --- /dev/null +++ b/geoserver/geoserver/defaults/main.yml @@ -0,0 +1,10 @@ +--- +geoserver_install: False +geoserver_major_version: '2.10' +geoserver_minor_version: 0 +geoserver_app_name: geoserver +geoserver_version: '{{ geoserver_major_version }}.{{ geoserver_minor_version }}' +geoserver_download_url: 'http://sourceforge.net/projects/geoserver/files/GeoServer/{{ geoserver_version }}/geoserver-{{ geoserver_version }}-war.zip' + +geoserver_download_directory: /srv/geoserver +geoserver_data_directory: /srv/geoserver_data diff --git a/geoserver/geoserver/tasks/main.yml b/geoserver/geoserver/tasks/main.yml new file mode 100644 index 00000000..794b336b --- /dev/null +++ b/geoserver/geoserver/tasks/main.yml @@ -0,0 +1,39 @@ +--- +- block: + - name: Create the Geoserver download directory + file: path={{ geoserver_download_directory }} state=directory + + - name: Create the Geoserver webapp directory + file: path={{ item.instance_path }}/webapps/{{ geoserver_app_name }} state=directory owner={{ item.user }} group={{ item.user }} + with_items: '{{ tomcat_m_instances }}' + + - name: Create the Geoserver data directory + file: path={{ geoserver_data_directory }} state=directory owner={{ item.user }} group={{ item.user }} + with_items: '{{ tomcat_m_instances }}' + + - name: Download and unpack the Geoserver file distribution + unarchive: copy=no src={{ geoserver_download_url }} dest={{ geoserver_download_directory }} creates={{ geoserver_download_directory }}/geoserver.war + + - name: Unpack the Geoserver war file + unarchive: copy=no src={{ geoserver_download_directory }}/geoserver.war dest={{ item.instance_path }}/webapps/{{ geoserver_app_name }} creates={{ item.instance_path }}/webapps/{{ geoserver_app_name }}/WEB-INF/lib owner={{ item.user }} group={{ item.user }} + with_items: '{{ tomcat_m_instances }}' + notify: tomcat instances restart + + when: geoserver_install + tags: geoserver + +- block: + - name: Remove the Geoserver webapp directory + file: path={{ item.instance_path }}/webapps/{{ geoserver_app_name }} state=absent + with_items: '{{ tomcat_m_instances }}' + notify: tomcat instances restart + + - name: Remove the Geoserver download and data directories + file: path={{ item }} state=absent + with_items: + - '{{ geoserver_download_directory }}' + - '{{ geoserver_data_directory }}' + + when: not geoserver_install + tags: geoserver + diff --git a/geoserver/spatialite/defaults/main.yml b/geoserver/spatialite/defaults/main.yml new file mode 100644 index 00000000..8c7742c9 --- /dev/null +++ b/geoserver/spatialite/defaults/main.yml @@ -0,0 +1,10 @@ +--- +geoserver_spatial_install: False +geoserver_spatial_url: 'http://ares.boundlessgeo.com/geoserver/{{ geoserver_major_version }}.x/community-latest/geoserver-{{ geoserver_major_version }}-SNAPSHOT-spatialite-plugin.zip' + +geoserver_spatial_dpkg_requirements: + - libgeos-c1 + - libproj0 + - proj-bin + +geoserver_spatial_db_dir: /srv/geoserver_spatialite/data