2016-09-27 15:33:26 +02:00
|
|
|
---
|
|
|
|
- block:
|
2016-09-28 11:58:42 +02:00
|
|
|
- name: Stop the service when upgrading
|
|
|
|
service: name='tomcat-instance-{{ authorization_http_port }}' state=stopped
|
|
|
|
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
|
|
|
|
|
|
|
- name: Get the authorization service war file
|
|
|
|
get_url: url={{ authorization_service_url }} dest={{ auth_instance_path }}/webapps/{{ authorization_service_file }}
|
|
|
|
|
|
|
|
- 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: 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
|
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
|
|
|
|
|
|
|
|
- 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
|
|
|
|
tags: ['authorization_service', 'tomcat' ]
|