Forge Home

tomcat

A module for managing Tomcat instances

14,665 downloads

14,665 latest version

3.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.2.0 (latest)
released Jun 22nd 2014

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'rdaviesuk-tomcat', '0.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add rdaviesuk-tomcat
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install rdaviesuk-tomcat --version 0.2.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

rdaviesuk/tomcat — version 0.2.0 Jun 22nd 2014

tomcat

Overview

A Puppet module for managing Tomcat instances.

Description

This module is intended for installing tomcat, and creating tomcat instances.

It allows for a reasonable amount of flexibility in the instance config, but does not handle deployment of application code, and nor does it handle instance-specific config files other than server.xml and sysconfig/.

It does not directly handle installing java, although installing a tomcat package will normally cause java to be installed as a dependency. To use different versions of Java, the JAVA_HOME can be set for each instance, although you will need to handle the install of that version of Java.

Compatibility

This module is currently aimed at the RHEL packaged versions of Tomcat, and relies on the RHEL init script to create tomcat instance services.

It has only been tested on RHEL6/CentOS6 with the base OS tomcat6 and EPEL testing tomcat (7) packages so far.

Usage

To install the base OS tomcat package (the module will try to figure out the details based on the OS, see params.pp):

  class { '::tomcat': }

To specify a particular tomcat package:

  class { '::tomcat':
    package_name   => 'tomcat',
    service_name   => 'tomcat',
    tomcat_version => '7.0',
    catalina_home  => '/usr/share/tomcat',
  }

To create an instance with default settings:

  class { '::tomcat': }

  tomcat::instance { 'mytomcat1' : }

To specify multiple instances with more specific settings (see instance.pp for all parameters):

  class { '::tomcat': }

  tomcat::instance { 'mytomcat1' : }
  tomcat::instance { 'mytomcat2' :
    ajp_port       => 8010,
    shutdown_port  => 8006,
    java_home      => '/usr/lib/jvm/jre-1.7.0-openjdk.x86_64',
  }

To override the tomcat class defaults (in this case we use an alternative version of tomcat we have installed elsewhere for mytomcat3, but use the base OS version of tomcat for mytomcat1 and mytomcat2):

  class { '::tomcat': }  

  tomcat::instance { 'mytomcat1' : }
  tomcat::instance { 'mytomcat2' :
    ajp_port       => 8010,
    shutdown_port  => 8006,
    java_home      => '/usr/lib/jvm/jre-1.7.0-openjdk.x86_64',
  }
  tomcat::instance { 'mytomcat3' :
    ajp_port       => 8011,
    shutdown_port  => 8007,
    parent_service => 'tomcat',
    tomcat_version => '7.0',
    catalina_home  => '/usr/share/tomcat',
    env_base       => '/etc/sysconfig',
    log_base       => '/var/log/tomcat',
    java_home      => '/usr/lib/jvm/jre-1.6.0-openjdk.x86_64',
  }

To have the tomcat class not install tomcat, but set some basic defaults for creating instances (here we have ensured that tomcat 7.0 is already installed under /usr/share/tomcat, and create two tomcat 7.0 instances):

  class { '::tomcat':
    package_ensure  => false,
    service_name   => 'tomcat',
    tomcat_version => '7.0',
    catalina_home  => '/usr/share/tomcat',
  }

  tomcat::instance { 'mytomcat1' : }
  tomcat::instance { 'mytomcat2' :
    ajp_port       => 8010,
    shutdown_port  => 8006,
  }