Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
$http_port,
$control_port,
$ajp_port = '',
$https_port = '',
$instance_autorestart = 'true',

$dirmode = '0755',
Expand All @@ -18,6 +19,7 @@

$java_opts = '-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC',
$catalina_opts = '',
$catalina_home = '',
$java_home = '',

$catalina_properties_template = '',
Expand Down Expand Up @@ -119,13 +121,23 @@
default => "-a ${ajp_port}",
}

$real_catalina_home = $catalina_home ? {
'' => '',
default => "-t ${catalina_home}",
}

$real_https_port = $https_port ? {
'' => '',
default => "-s ${https_port}",
}

$real_runtime_dir = $runtime_dir ? {
'' => '',
default => "-r ${runtime_dir}/${instance_name}",
}

$instance_create_instance_cmd_exec = $create_instance_cmd_exec ? {
'' => "/usr/bin/tomcat-instance-create -p ${http_port} -c ${control_port} ${real_ajp_port} -w ${magicword} -o ${instance_owner} -g ${instance_group} ${real_runtime_dir} ${instance_path}",
'' => "/usr/bin/tomcat-instance-create -p ${http_port} -c ${control_port} ${real_https_port} ${real_ajp_port} ${real_catalina_home} -w ${magicword} -o ${instance_owner} -g ${instance_group} ${real_runtime_dir} ${instance_path}",
default => $create_instance_cmd_exec,
}

Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/(?i:CentOS|RedHat|Scientific)/ => $::lsbmajdistrelease ? {
5 => '5',
6 => '6',
7 => '7',
default => '6',
},
/(?i:Amazon)/ => $::lsbmajdistrelease ? {
Expand Down
65 changes: 65 additions & 0 deletions templates/instance/defaults7-RedHat.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# File Managed by Puppet

# Service-specific configuration file for tomcat7. This will be sourced by
# the SysV init script after the global configuration file
# /etc/tomcat7/tomcat7.conf, thus allowing values to be overridden in
# a per-service manner.
#
# NEVER change the init script itself. To change values for all services make
# your changes in /etc/tomcat7/tomcat7.conf
#
# To change values for a specific service make your edits here.
# To create a new service create a link from /etc/init.d/<your new service> to
# /etc/init.d/tomcat7 (do not copy the init script) and make a copy of the
# /etc/sysconfig/tomcat7 file to /etc/sysconfig/<your new service> and change
# the property values so the two services won't conflict. Register the new
# service in the system as usual (see chkconfig and similars).
#

# Where your java installation lives
<% if @java_home != '' -%>
JAVA_HOME=<%= @java_home %>
<% end -%>

# Where your tomcat installation lives
CATALINA_BASE="/var/lib/tomcat7-<%= @instance_name %>"
CATALINA_HOME="<%= @catalina_home %>"
#JASPER_HOME="/usr/share/tomcat7"
#CATALINA_TMPDIR="/var/cache/tomcat7/temp"

# You can pass some parameters to java here if you wish to
<% if @java_opts != '' -%>
JAVA_OPTS="<%= @java_opts %>"
<% end -%>
<% if @catalina_opts != '' -%>
CATALINA_OPTS="<%= @catalina_opts %>"
<% end -%>


# What user should run tomcat
TOMCAT_USER="<%= @instance_owner %>"

# You can change your tomcat locale here
#LANG="en_US"

# Run tomcat under the Java Security Manager
#SECURITY_MANAGER="false"

# Time to wait in seconds, before killing process
#SHUTDOWN_WAIT="30"

# Whether to annoy the user with "attempting to shut down" messages or not
#SHUTDOWN_VERBOSE="false"

# Set the TOMCAT_PID location
CATALINA_PID="/var/run/tomcat7-<%= @instance_name %>.pid"

# Connector port is 8080 for this tomcat7 instance
CONNECTOR_PORT="<%= @control_port %>"

TOMCAT_LOG="$CATALINA_BASE/logs/catalina.out"

# If you wish to further customize your tomcat environment,
# put your own definitions here
# (i.e. LD_LIBRARY_PATH for some jdbc drivers)

Loading