Skip to content

Instantly share code, notes, and snippets.

@bobobox
Created November 7, 2014 22:14
Show Gist options
  • Save bobobox/8b332e3a3f8071ff037c to your computer and use it in GitHub Desktop.
Save bobobox/8b332e3a3f8071ff037c to your computer and use it in GitHub Desktop.
Produces left spaces in front
#!/bin/sh
#####################################################
# This file was created by Ansible from a template. #
# Manual changes will be reverted upon next run. #
#####################################################
{% if tomcat_java_opts is defined -%}
# JAVA_OPTS gets applied at both startup and shutdown of Tomcat
JAVA_OPTS="{{ tomcat_java_opts.stdout }}"
{% endif %}
{% if tomcat_catalina_opts is defined -%}
# CATALINA_OPTS gets applied only at startup of Tomcat, not shutdown
{% set opts_string = '' -%}
{% for key, value in tomcat_catalina_opts.iteritems() -%}
{% set opts_string = "%s-%s=%s " % (opts_string,key,value) -%}
{% if loop.last -%}
{# We do it this way because of Jinja variable scope limits #}
CATALINA_OPTS="{{ opts_string }}"
{% endif -%}
{% endfor -%}
{% endif %}
{% if tomcat_logs_dir is defined -%}
CATALINA_OUT="{{ tomcat_logs_dir }}/catalina.out"
{% endif %}
{% if tomcat_temp_dir is defined -%}
CATALINA_TEMP="{{ tomcat_temp_dir }}"
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment