/srr_tomcat

Chef cookbook for deploying tomcat on Linux

Primary LanguageHTMLApache License 2.0Apache-2.0

srr_tomcat Cookbook

Installs tomcat from a file on an HTTP share. Sets up a user and group for the tomcat service. Sets custom catalina options. Can enable tomcat clustering but not on by default. JDBC files included. Deployment script for jenkins WAR file deployments. Sets up permissions for a user account for WAR deployments. Sets up files for jmx monitoring. It is enabled by default.

NOTE: If you want to use the deploy account with tomcat, make sure to run the srr_deploy cookbook before you run this cookbook.

Requirements

Linux only.

Tested on... CentOS 6.5 RHEL 6.5

Depends on srr_jdk cookbook for java

NOTE: If you want to use the deploy account with tomcat, make sure to run the srr_deploy cookbook before you run this cookbook.

Attributes

srr_tomcat::default

Key Type Description Default
['srr_tomcat']['downloadurlroot'] String URL that contains the tomcat install tar.gz "http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.56/bin/"
['srr_tomcat']['version'] String Basically the name of the tomcat tar.gz file without the .tar.gz "apache-tomcat-7.0.54"
['srr_tomcat']['root'] String The root folder for the tomcat install "/usr/local"
['srr_tomcat']['user'] String The user account for running the tomcat service "tomcat"
['srr_tomcat']['group'] String The group for permissions to the tomcat service "tomcat"
['srr_tomcat']['logsdir'] String The location of the logs directory "#{['srr_tomcat']['root']}/tomcat/logs"
['srr_tomcat']['catalina_opts'] String The options for catalina ""-Xms512m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dorg.apache.jasper.compiler.Parser.STRICT_WHITESPACE=false -Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE=true -Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0=true -Dcom.sun.management.jmxremote.port=10080""
['srr_tomcat']['multicast'] String An optional block for enabling multicast. Commented out by default ""
['srr_tomcat']['useremoteipvalve'] String An option for enabling the RemoteIpValve. Off by default. If you use this, make sure to use %a in the log pattern instead of %{X-Forwarded-For}i to get the X-Forwarded-For from the ACE. "yes"
['srr_tomcat']['accesslogvalvepattern'] String The format of the access log in server.xml "%a %l %u %t %r %s %b %{User-Agent}i %D"
Key Type Description Default
['srr_tomcat']['jdbc_drivers_to_add'] Array The list of JDBC drivers to copy. Files must exist in the cookbooks /files/default folder. ['jconn2.jar', 'jtds-1.2.jar', 'sqljdbc41.jar']
['srr_tomcat']['jdbc_drivers_to_delete'] Array The list of JDBC drivers to delete from the file system. ['sqljdbc.jar']
['srr_tomcat']['jdbc_resource'] String Define a JDBC resource here ''
['srr_tomcat']['jndi'] String Configure a JNDI resource here ''
['srr_tomcat']['multipart_config'] String Increasing this can allow larger WAR files to be deployed through the Manager interface in tomcat " 52428800 52428800 0 "
['srr_tomcat']['tomcat_users'] String Config for tomcat-users.xml if you want to deploy a WAR with the manager interface ""
['srr_tomcat']['password_databag'] String The name of the databag with the encrypted tomcat user password 'tomcat'
['srr_tomcat']['tomcat_user_password'] String Openssl MD5 encrypted password for the tomcat user Read from an encrypted data bag

Usage

srr_tomcat::default

Use a wrapper cookbook

In your metadata.rb: add the line 'depends srr_tomcat' In your recipes/default.rb: add the line 'include_recipe srr_tomcat' In your attributes/default.rb: Override any attributes you like.

Or, just include srr_tomcat in your node's run_list:

{
  "name":"my_node",
  "run_list": [
    "recipe[srr_tomcat]"
  ]
}

License and Authors

Authors: Steven Riggs