forked from ISTI-ansible-roles/ansible-roles
54 lines
2.4 KiB
YAML
54 lines
2.4 KiB
YAML
---
|
|
- block:
|
|
- name: Create the Geonetwork download directory
|
|
file: path={{ geonetwork_download_directory }} state=directory
|
|
|
|
- name: Create the Geonetwork data directory
|
|
file: path={{ geonetwork_data_directory }} state=directory owner={{ item.user }} group={{ item.user }}
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
- name: Remove the geonetwork webapp if we are upgrading
|
|
file: dest={{ item.instance_path }}/webapps/{{ geonetwork_app_name }} state=absent
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
when: geonetwork_upgrade
|
|
|
|
- name: Remove the geonetwork distribution file if we are upgrading
|
|
file: dest={{ geonetwork_download_directory }}/geonetwork.war state=absent
|
|
when: geonetwork_upgrade
|
|
|
|
- name: Create the Geonetwork download directory
|
|
file: path={{ geonetwork_download_directory }} state=directory
|
|
|
|
- name: Create the Geonetwork webapp directory
|
|
file: path={{ item.instance_path }}/webapps/{{ geonetwork_app_name | lower }} state=directory owner={{ item.user }} group={{ item.user }}
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
- name: Download the Geonetwork file distribution
|
|
get_url: url='{{ geonetwork_download_url }}' dest={{ geonetwork_download_directory }}/geonetwork.war
|
|
|
|
- name: Unpack the Geonetwork war file
|
|
unarchive: copy=no src={{ geonetwork_download_directory }}/geonetwork.war dest={{ item.instance_path }}/webapps/{{ geonetwork_app_name | lower }} creates={{ item.instance_path }}/webapps/{{ geonetwork_app_name | lower }}/WEB-INF/lib owner={{ item.user }} group={{ item.user }}
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
notify: tomcat instances restart
|
|
|
|
- name: Configure geonetwork using our template
|
|
template: src=geonetwork_config.xml.j2 dest={{ item.instance_path }}/webapps/{{ geonetwork_app_name | lower }}/WEB-INF/config.xml
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
notify: tomcat instances restart
|
|
|
|
when: geonetwork_install
|
|
tags: geonetwork
|
|
|
|
- block:
|
|
- name: Remove the Geonetwork webapp directory
|
|
file: path={{ item.instance_path }}/webapps/{{ geonetwork_app_name | lower }} state=absent
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
notify: tomcat instances restart
|
|
|
|
- name: Remove the geonetwork distribution file
|
|
file: dest={{ geonetwork_download_directory }}/geonetwork.war state=absent
|
|
|
|
when: not geonetwork_install
|
|
tags: geonetwork
|
|
|