diff --git a/tomcat/context.sls b/tomcat/context.sls index 59d2b5ce..ada5ac1d 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 %} 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 }}