From 5b63d49f11bae29ba5640ad6612268a7d248470b Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 3 May 2019 16:50:26 +0200 Subject: [PATCH 1/4] added new template for managing the tomcat 8 settings --- .../catalina-app-conf_tomcat8.xml.j2 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 smartgears/catalina-app-conf/templates/catalina-app-conf_tomcat8.xml.j2 diff --git a/smartgears/catalina-app-conf/templates/catalina-app-conf_tomcat8.xml.j2 b/smartgears/catalina-app-conf/templates/catalina-app-conf_tomcat8.xml.j2 new file mode 100644 index 00000000..f5080172 --- /dev/null +++ b/smartgears/catalina-app-conf/templates/catalina-app-conf_tomcat8.xml.j2 @@ -0,0 +1,19 @@ + + + +{% if item.plugin_name is defined %} + +{% else %} +{% for plugin in item.app_plugins %} + +{% endfor %} +{% endif %} + + + From de1845044f9442e5f2bf6873246190b163928545 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 3 May 2019 16:53:47 +0200 Subject: [PATCH 2/4] added task for managing the ubuntu 18 case --- smartgears/catalina-app-conf/tasks/main.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/smartgears/catalina-app-conf/tasks/main.yml b/smartgears/catalina-app-conf/tasks/main.yml index 1dd6cbe8..1e724f3f 100644 --- a/smartgears/catalina-app-conf/tasks/main.yml +++ b/smartgears/catalina-app-conf/tasks/main.yml @@ -1,14 +1,19 @@ --- - block: - - name: Install the catalina webapp configurations + - name: Install the catalina webapp configurations with distro <=16 template: src=catalina-app-conf.xml.j2 dest={{ smartgears_instance_path }}/conf/Catalina/localhost/{{ item.app_name }}.xml with_items: '{{ catalina_apps_conf }}' - when: ( item.state | default(True) ) + when: ( item.state | default(True) ) and ansible_distribution_major_version <= '16' - - name: Remove the catalina webapp configurations + - name: Install the catalina webapp configurations with distro == 18 + template: src=catalina-app-conf_tomcat8.xml.j2 dest={{ smartgears_instance_path }}/conf/Catalina/localhost/{{ item.app_name }}.xml + with_items: '{{ catalina_apps_conf }}' + when: ( item.state | default(True) ) and ansible_distribution_major_version == '18' + + - name: Remove the catalina webapp configurations file: dest={{ smartgears_instance_path }}/conf/Catalina/localhost/{{ item.app_name }}.xml state=absent with_items: '{{ catalina_apps_conf }}' - when: ( not item.state | default(True) ) + when: ( not item.state | default(True) ) and ansible_distribution_major_version <= '16' become: True become_user: '{{ smartgears_user }}' From 9ac932ffd16c4e11c3f7fe37b8f7fc4566678ea8 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 3 May 2019 16:55:08 +0200 Subject: [PATCH 3/4] managed the tomcat7 case with more than one plugin --- .../catalina-app-conf/templates/catalina-app-conf.xml.j2 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/smartgears/catalina-app-conf/templates/catalina-app-conf.xml.j2 b/smartgears/catalina-app-conf/templates/catalina-app-conf.xml.j2 index 3a858ef5..26952a64 100644 --- a/smartgears/catalina-app-conf/templates/catalina-app-conf.xml.j2 +++ b/smartgears/catalina-app-conf/templates/catalina-app-conf.xml.j2 @@ -2,6 +2,11 @@ +{% else %} +{% for plugin in item.app_plugins %} + virtualClasspath="{{ smartgears_instance_path }}/webapps/{{ item.app_name }}/WEB-INF/lib/plugins/{{ plugin }}/*.jar"/> +{% endfor %} +{% endif %} - From 927c2f79b91676db3bb9da8d94155ef6cc530cdf Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Fri, 3 May 2019 16:58:20 +0200 Subject: [PATCH 4/4] fix Remove the catalina webapp configurations task --- smartgears/catalina-app-conf/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smartgears/catalina-app-conf/tasks/main.yml b/smartgears/catalina-app-conf/tasks/main.yml index 1e724f3f..84aa3a3e 100644 --- a/smartgears/catalina-app-conf/tasks/main.yml +++ b/smartgears/catalina-app-conf/tasks/main.yml @@ -13,7 +13,7 @@ - name: Remove the catalina webapp configurations file: dest={{ smartgears_instance_path }}/conf/Catalina/localhost/{{ item.app_name }}.xml state=absent with_items: '{{ catalina_apps_conf }}' - when: ( not item.state | default(True) ) and ansible_distribution_major_version <= '16' + when: ( not item.state | default(True) ) become: True become_user: '{{ smartgears_user }}'