forked from ISTI-ansible-roles/ansible-roles
55 lines
2.5 KiB
YAML
55 lines
2.5 KiB
YAML
---
|
|
- 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 validate_certs=False
|
|
|
|
- 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
|
|
|
|
- name: Remove the postgres jdbc driver when we want a JNDI profile
|
|
shell: rm -f {{ item.instance_path }}/webapps/{{ geoserver_app_name }}/WEB-INF/lib/postgresql*.jdbc*.jar
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
when: tomcat_install_pg_jdbc
|
|
notify: tomcat instances restart
|
|
|
|
- name: Download newer jar files when needed
|
|
get_url: url={{ item.1.url }} dest={{ item.0.instance_path }}/webapps/{{ geoserver_app_name }}/WEB-INF/lib/{{ item.1.file }} owner={{ item.0.user }} group={{ item.0.user }} force=yes
|
|
with_together:
|
|
- '{{ tomcat_m_instances }}'
|
|
- '{{ geoserver_patches_data | default (omit) }}'
|
|
when: geoserver_additional_jars
|
|
notify: tomcat instances restart
|
|
tags: [ 'geoserver', 'geopatch' ]
|
|
|
|
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
|
|
|