2017-09-05 16:00:52 +02:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Remove the Thredds webapp directory
|
2017-09-05 17:40:52 +02:00
|
|
|
file: path={{ item.instance_path }}/webapps/{{ thredds_app_name | lower }} state=absent
|
2017-09-05 16:00:52 +02:00
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
notify: tomcat instances restart
|
|
|
|
|
|
|
|
when: not thredds_install or thredds_upgrade
|
|
|
|
tags: [ 'thredds', 'tomcat' ]
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Create the Thredds webapp directory
|
2017-09-05 17:40:52 +02:00
|
|
|
file: path={{ item.instance_path }}/webapps/{{ thredds_app_name | lower }} state=directory owner={{ item.user }} group={{ item.user }}
|
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
|
|
|
|
- name: Create the Thredds data directory
|
|
|
|
file: path={{ thredds_data_content_dir }} state=directory owner={{ item.user }} group={{ item.user }}
|
2017-09-05 16:00:52 +02:00
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
|
2017-12-06 18:18:42 +01:00
|
|
|
- name: Check if the configuration files were already initialized with our versions
|
|
|
|
stat: path={{ thredds_data_content_dir }}/thredds/.conf_initialized
|
|
|
|
register: thredds_skip_conf
|
|
|
|
tags: [ 'thredds', 'tomcat', 'thredds_conf' ]
|
|
|
|
|
2017-09-05 17:40:52 +02:00
|
|
|
- name: Install the Thredds configuration files
|
2017-12-11 18:48:04 +01:00
|
|
|
template: src={{ item[1] }}.j2 dest={{ thredds_data_content_dir }}/thredds/{{ item[1] }} owner={{ item.0.user }} group={{ item.0.user }} mode=644
|
|
|
|
with_nested:
|
|
|
|
- '{{ tomcat_m_instances }}'
|
|
|
|
- ['threddsConfig.xml','catalog.xml']
|
2017-09-06 12:37:39 +02:00
|
|
|
notify: tomcat instances restart
|
2017-12-06 18:18:42 +01:00
|
|
|
when: not thredds_skip_conf.stat.exists
|
|
|
|
tags: [ 'thredds', 'tomcat', 'thredds_conf' ]
|
|
|
|
|
|
|
|
- name: Create the file that states that the thredds instance has been configured
|
|
|
|
copy: content="initialized by ansible" dest={{ thredds_data_content_dir }}/thredds/.conf_initialized mode=0400
|
|
|
|
register: thredds_skip_conf
|
2017-09-06 12:37:39 +02:00
|
|
|
tags: [ 'thredds', 'tomcat', 'thredds_conf' ]
|
2017-09-05 17:40:52 +02:00
|
|
|
|
2017-09-05 16:00:52 +02:00
|
|
|
- name: Get the thredds war file
|
|
|
|
maven_artifact: artifact_id={{ thredds_name }} version={{ thredds_version | default(omit) }} group_id={{ thredds_group_id }} extension={{ thredds_extension | default('war') }} repository_url={{ thredds_repository_url }} dest={{ thredds_download_directory }}/{{ thredds_file }}
|
2017-09-08 17:37:01 +02:00
|
|
|
|
|
|
|
- name: Add the netcdf nschloe ppa
|
|
|
|
apt_repository: repo='ppa:nschloe/netcdf-backports' update_cache=yes
|
|
|
|
|
|
|
|
- name: Install the NetCDF
|
|
|
|
apt: name={{ item }} state=latest update_cache=yes cache_valid_time=3600
|
|
|
|
with_items: 'netcdf-bin'
|
2017-09-05 16:00:52 +02:00
|
|
|
|
|
|
|
- name: Unarchive the thredds war
|
2017-09-05 17:40:52 +02:00
|
|
|
unarchive: copy=no src={{ thredds_download_directory }}/{{ thredds_file }} dest={{ item.instance_path }}/webapps/{{ thredds_app_name | lower }} creates={{ item.instance_path }}/webapps/{{ thredds_app_name | lower }}/WEB-INF/lib owner={{ item.user }} group={{ item.user }}
|
2017-09-05 16:00:52 +02:00
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
notify: tomcat instances restart
|
|
|
|
|
2017-12-18 15:51:29 +01:00
|
|
|
- name: Install the Thredds configuration files
|
|
|
|
template: src=web.xml.j2 dest={{ item.instance_path }}/webapps/{{ thredds_app_name | lower }}/WEB-INF/web.xml owner={{ item.user }} group={{ item.user }} mode=644
|
|
|
|
with_items: '{{ tomcat_m_instances }}'
|
|
|
|
notify: tomcat instances restart
|
|
|
|
tags: [ 'thredds', 'tomcat', 'thredds_conf', 'thredds_webxml' ]
|
|
|
|
|
2017-09-05 16:00:52 +02:00
|
|
|
when: thredds_install
|
|
|
|
tags: [ 'thredds', 'tomcat' ]
|
|
|
|
|