ansible-roles/gcube/authorization_service/tasks/main.yml

32 lines
1.7 KiB
YAML
Raw Normal View History

---
- block:
- 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'
when: authorization_upgrade or not authorization_service_install
- 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
with_items: '{{ tomcat_m_instances }}'
notify: tomcat instances restart
- 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
with_items: '{{ tomcat_m_instances }}'
notify: tomcat instances restart
become: True
become_user: '{{ auth_user }}'
when: authorization_service_install
tags: ['authorization_service', 'tomcat' ]