From 6c536c91ac9b417bbe55be842d8450cb95c73f3c Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 16 Oct 2018 17:34:59 +0200 Subject: [PATCH] Remove the gcube-app.xml or gcube-handlers.xml files when they are not needed. --- smartgears/gcubeapp-setup/tasks/main.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/smartgears/gcubeapp-setup/tasks/main.yml b/smartgears/gcubeapp-setup/tasks/main.yml index 7a54d3d5..96c37070 100644 --- a/smartgears/gcubeapp-setup/tasks/main.yml +++ b/smartgears/gcubeapp-setup/tasks/main.yml @@ -13,3 +13,17 @@ when: gcubehandlers_setup tags: [ 'smartgears', 'gcubeapp' ] +- name: Remove the gcube-app.xml file when it is not needed + file: dest={{ item.webapp_path | default('/home/gcube/tomcat') }}/webapps/{{ item.webapp_context }}/WEB-INF/gcube-app.xml owner={{ smartgears_user }} group={{ smartgears_user }} state=absent + with_items: '{{ gcubeapp_webapps | default([]) }}' + notify: Restart smartgears + when: not gcubeapp_setup + tags: [ 'smartgears', 'gcubeapp' ] + +- name: Remove the gcube-handlers.xml file when it is not needed + file: dest={{ item.webapp_path | default('/home/gcube/tomcat') }}/webapps/{{ item.webapp_context }}/WEB-INF/gcube-handlers.xml owner={{ smartgears_user }} group={{ smartgears_user }} state=absent + with_items: '{{ gcubeapp_webapps | default([]) }}' + notify: Restart smartgears + when: not gcubehandlers_setup + tags: [ 'smartgears', 'gcubeapp' ] +