diff --git a/smartgears/gcubeapp-setup/defaults/main.yml b/smartgears/gcubeapp-setup/defaults/main.yml index a3697411..503c22fd 100644 --- a/smartgears/gcubeapp-setup/defaults/main.yml +++ b/smartgears/gcubeapp-setup/defaults/main.yml @@ -1,7 +1,6 @@ --- gcubeapp_setup: False - +gcubehandlers_setup: False #gcubeapp_webapps: -# - { webapp_context: '', webapp_name: '', version: '', webapp_group: '', description: '', exclude_handlers: [ '' ] } +# - { webapp_context: '', webapp_name: '', version: '', webapp_group: '', description: '', exclude_handlers: [ '' ], gcubehandlers_requests: [ 'authentication-filter' ] } - diff --git a/smartgears/gcubeapp-setup/tasks/main.yml b/smartgears/gcubeapp-setup/tasks/main.yml index bc7e2426..4b799b70 100644 --- a/smartgears/gcubeapp-setup/tasks/main.yml +++ b/smartgears/gcubeapp-setup/tasks/main.yml @@ -1,8 +1,15 @@ --- - name: Install the gcube-app file to make the webapp smartgears compatible template: src=gcube-app.xml.j2 dest={{ item.webapp_path | default('/home/gcube/tomcat') }}/webapps/{{ item.context }}/WEB-INF/gcube-app.xml owner={{ smartgears_user }} group={{ smartgears_user }} - with_items: '{{ gcubeapp_webapps | default (omit) }}' + with_items: '{{ gcubeapp_webapps | default([]) }}' notify: Restart smartgears when: gcubeapp_setup tags: [ 'smartgears', 'gcubeapp' ] +- name: Install the gcube-handlers.xml file to manage the smartgears filters + template: src=gcube-handlers.xml.j2 dest={{ item.webapp_path | default('/home/gcube/tomcat') }}/webapps/{{ item.context }}/WEB-INF/gcube-handlers.xml owner={{ smartgears_user }} group={{ smartgears_user }} + with_items: '{{ gcubeapp_webapps | default([]) }}' + notify: Restart smartgears + when: gcubehandlers_setup + tags: [ 'smartgears', 'gcubeapp' ] + diff --git a/smartgears/gcubeapp-setup/templates/gcube-handlers.xml.j2 b/smartgears/gcubeapp-setup/templates/gcube-handlers.xml.j2 new file mode 100644 index 00000000..1168f2ac --- /dev/null +++ b/smartgears/gcubeapp-setup/templates/gcube-handlers.xml.j2 @@ -0,0 +1,12 @@ + + + + + + + +{% for req in item. gcubehandlers_requests %} + <{{ req }} /> +{% endfor %} + +