2016-09-27 15:33:26 +02:00
|
|
|
---
|
|
|
|
- block:
|
2016-09-28 11:58:42 +02:00
|
|
|
- name: Stop the service when upgrading
|
2016-12-13 15:19:56 +01:00
|
|
|
#service: name='tomcat-instance-{{ authorization_http_port }}' state=stopped
|
|
|
|
service: name=tomcat-instance-8080 state=stopped
|
2016-09-28 11:58:42 +02:00
|
|
|
when: authorization_service_upgrade
|
|
|
|
|
2016-09-27 15:33:26 +02:00
|
|
|
- name: Remove the installed authorization service before upgrading
|
|
|
|
file: dest={{ item }} state=absent
|
|
|
|
with_items:
|
|
|
|
- '{{ auth_instance_path }}/webapps/authorization-service'
|
|
|
|
- '{{ auth_instance_path }}/webapps/authorization-service.war'
|
2016-09-28 11:58:42 +02:00
|
|
|
when: authorization_service_upgrade or not authorization_service_install
|
2016-09-27 15:33:26 +02:00
|
|
|
|
2016-10-20 17:09:13 +02:00
|
|
|
# - name: Get the authorization service war file
|
|
|
|
# get_url: url={{ authorization_service_url }} dest={{ auth_instance_path }}/webapps/{{ authorization_service_file }}
|
2016-09-27 15:33:26 +02:00
|
|
|
|
2016-10-20 17:09:13 +02:00
|
|
|
# - name: Unpack the authorization service war file
|
|
|
|
# shell: mkdir {{ auth_instance_path }}/webapps/authorization-service ; cd {{ auth_instance_path }}/webapps/authorization-service ; jar xf {{ auth_instance_path }}/webapps/{{ authorization_service_file }}
|
|
|
|
# args:
|
|
|
|
# creates: '{{ auth_instance_path }}/webapps/authorization-service/WEB-INF/AuthorizationConfiguration.xml'
|
|
|
|
|
|
|
|
- name: Create the authorization service webapp directory
|
|
|
|
file: dest={{ auth_instance_path }}/webapps/authorization-service state=directory
|
|
|
|
|
|
|
|
- name: Get and unpack the authorization war file
|
|
|
|
unarchive: copy=no src={{ authorization_service_url }} dest={{ auth_instance_path }}/webapps/authorization-service
|
2016-09-27 15:33:26 +02:00
|
|
|
args:
|
|
|
|
creates: '{{ auth_instance_path }}/webapps/authorization-service/WEB-INF/AuthorizationConfiguration.xml'
|
|
|
|
|
|
|
|
- name: Install the authorization service AuthorizationConfiguration.xml template
|
|
|
|
template: src=AuthorizationConfiguration.xml.j2 dest={{ auth_instance_path }}/webapps/authorization-service/{{ authorization_service_config_dest }} mode=0440
|
2016-09-28 11:58:42 +02:00
|
|
|
notify: Restart the authorization service
|
2017-08-21 15:14:49 +02:00
|
|
|
tags: [ 'authorization_service', 'authorization_service_conf', 'tomcat' ]
|
2016-09-27 15:33:26 +02:00
|
|
|
|
|
|
|
- name: Install the authorization service persistence.xml template
|
|
|
|
template: src=persistence.xml.j2 dest={{ auth_instance_path }}/webapps/authorization-service/{{ authorization_service_persistence_dest }} mode=0440
|
2016-09-28 11:58:42 +02:00
|
|
|
notify: Restart the authorization service
|
2017-08-21 15:14:49 +02:00
|
|
|
tags: [ 'authorization_service', 'authorization_service_conf', 'tomcat' ]
|
2016-09-28 11:58:42 +02:00
|
|
|
|
|
|
|
- name: Install the logback configuration
|
|
|
|
template: src=logback.xml.j2 dest={{ auth_instance_path }}/lib/logback.xml mode=0644
|
|
|
|
notify: Restart the authorization service
|
2016-09-27 15:33:26 +02:00
|
|
|
|
|
|
|
become: True
|
|
|
|
become_user: '{{ auth_user }}'
|
|
|
|
when: authorization_service_install
|
2017-08-21 15:14:49 +02:00
|
|
|
tags: [ 'authorization_service', 'tomcat' ]
|