From e3e7598c4dee1ee420898f9f92289ef21eac22b0 Mon Sep 17 00:00:00 2001 From: preussal Date: Tue, 31 Mar 2020 14:48:27 +0700 Subject: [PATCH 1/3] Update context.sls Developers of mine want to deploy in catalina_base / webapps. That's why I have to set this separately. Without the directories, the Tomcat will not start. Therefore here is a small query to create the directories in catalina_base. --- tomcat/context.sls | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tomcat/context.sls b/tomcat/context.sls index 59d2b5ce..7624bf61 100644 --- a/tomcat/context.sls +++ b/tomcat/context.sls @@ -23,6 +23,23 @@ tomcat {{ tomcat.catalina_home }}/webapps/{{ data['appBase'] }}: - makedirs: True - require_in: - file: tomcat {{ tomcat.conf_dir }}/context.xml + +#Tomcat fails if pillar-defined webapps are not deployed yet. +# if catalina_base != catalina_home + {% if tomcat.catalina_base != tomcat.catalina_home %} +tomcat {{ tomcat.catalina_base }}/webapps/{{ data['appBase'] }}: + file.directory: + - name: {{ tomcat.catalina_base }}/webapps/{{ data['appBase'] }} + {% if grains.os != 'MacOS' %} + #Inherit logged-on user permissions on Darwin + - user: {{ tomcat.user }} + - group: {{ tomcat.group }} + {% endif %} + - mode: 775 + - makedirs: True + - require_in: + - file: tomcat {{ tomcat.conf_dir }}/context.xml + {% endif %} {% endif %} {% endfor %} {% endfor %} From ef2aa2ded8e65656dd9aca0e5af54d1b5a95ef28 Mon Sep 17 00:00:00 2001 From: preussal Date: Tue, 31 Mar 2020 14:57:57 +0700 Subject: [PATCH 2/3] Update context.sls Sorry Taps --- tomcat/context.sls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tomcat/context.sls b/tomcat/context.sls index 7624bf61..ada5ac1d 100644 --- a/tomcat/context.sls +++ b/tomcat/context.sls @@ -23,9 +23,9 @@ tomcat {{ tomcat.catalina_home }}/webapps/{{ data['appBase'] }}: - makedirs: True - require_in: - file: tomcat {{ tomcat.conf_dir }}/context.xml - + #Tomcat fails if pillar-defined webapps are not deployed yet. -# if catalina_base != catalina_home +# if catalina_base != catalina_home {% if tomcat.catalina_base != tomcat.catalina_home %} tomcat {{ tomcat.catalina_base }}/webapps/{{ data['appBase'] }}: file.directory: From 7ef76115e023f7b25077bafa222dadc6a45ea436 Mon Sep 17 00:00:00 2001 From: preussal Date: Tue, 31 Mar 2020 15:16:33 +0700 Subject: [PATCH 3/3] Set accumulator name for native and vhosts Set accumulator name for native and vhosts (fixes saltstack-formulas#106) --- tomcat/native.sls | 1 + tomcat/vhosts.sls | 1 + 2 files changed, 2 insertions(+) diff --git a/tomcat/native.sls b/tomcat/native.sls index fcc5075c..320df65c 100644 --- a/tomcat/native.sls +++ b/tomcat/native.sls @@ -9,6 +9,7 @@ tomcat {{ tomcat.native_pkg }}: tomcat 200_server_xml: file.accumulated: + - name: 200_server_xml - filename: {{ tomcat.conf_dir }}/server.xml - text: enabled - require_in: diff --git a/tomcat/vhosts.sls b/tomcat/vhosts.sls index 171fc480..58441506 100644 --- a/tomcat/vhosts.sls +++ b/tomcat/vhosts.sls @@ -5,6 +5,7 @@ include: tomcat 300_server_xml: file.accumulated: + - name: 300_server_xml - filename: {{ tomcat.conf_dir }}/server.xml {% if tomcat.sites is defined %} - text: {{ tomcat.sites }}