geonetwork: modify the role so that we always upgrade when a new distribution is downloaded. Support version 3.2.1.

This commit is contained in:
Andrea Dell'Amico 2017-09-20 13:38:39 +02:00
parent a758ab8c71
commit 3758e0422a
2 changed files with 12 additions and 2 deletions

View File

@ -21,10 +21,16 @@
with_items: '{{ tomcat_m_instances }}'
- name: Download the Geonetwork file distribution
get_url: url='{{ geonetwork_download_url }}' dest={{ geonetwork_download_directory }}/geonetwork.war
get_url: url='{{ geonetwork_download_url }}' dest={{ geonetwork_download_directory }}/geonetwork.{{ geonetwork_version }}.war
register: geonetwork_download
- name: Remove the geonetwork webapp if we downloaded a new version
file: dest={{ item.instance_path }}/webapps/{{ geonetwork_app_name }} state=absent
with_items: '{{ tomcat_m_instances }}'
when: ( geonetwork_download | changed )
- 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 }}
unarchive: copy=no src={{ geonetwork_download_directory }}/geonetwork.{{ geonetwork_version }}.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

View File

@ -676,7 +676,11 @@ INSERT INTO HarvesterSettings (id, parentid, name, value) VALUES (1,NULL,'harve
-- === Table: Users
-- ======================================================================
{% if geonetwork_minor_version >= 2 %}
INSERT INTO Users (id, username, password, name, surname, profile, kind, organisation, security, authtype, isenabled) VALUES (1,'admin','46e44386069f7cf0d4f2a420b9a2383a612f316e2024b0fe84052b0b96c479a23e8a0be8b90fb8c2','admin','admin',0,'','','','', 'y');
{% else %}
INSERT INTO Users (id, username, password, name, surname, profile, kind, organisation, security, authtype, enabled) VALUES (1,'admin','46e44386069f7cf0d4f2a420b9a2383a612f316e2024b0fe84052b0b96c479a23e8a0be8b90fb8c2','admin','admin',0,'','','','', true);
{% endif %}
INSERT INTO Address (id, address, city, country, state, zip) VALUES (1, '', '', '', '', '');
INSERT INTO UserAddress (userid, addressid) VALUES (1, 1);