Forge Home

tomcats

Puppet module to manage several Apache Tomcat instances on one node

14,871 downloads

10,869 latest version

0.4 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

  • 1.3.3 (latest)
  • 1.3.2
  • 1.3.1
  • 1.1.1
  • 1.1.0
released Aug 19th 2015

Start using this module

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

Add this module to your Puppetfile:

mod 'echomike80-tomcats', '1.3.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add echomike80-tomcats
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install echomike80-tomcats --version 1.3.3

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

echomike80/tomcats — version 1.3.3 Aug 19th 2015

Puppet Tomcat(s) Module

Introduction

With this Puppet module you can manage several Apache Tomcat instances on one node. You are able to deploy multiple instances of different Tomcat versions each with separate Java versions if needed. This module handles Apache Tomcat on Linux (preferred, of course ;-) ) and also on Windows. I used Tanuki Java Service Wrapper on Linux and recommend to use YAJSW on Windows to install a service for the instance. Java/Tomcat configuration is set in (yajsw)/conf/wrapper.conf and you can customize your settings afterwards.

On Linux it is also possible to update each Tomcat instance. When you change "tomcat_release" then a new tarball will be extracted into your tomcat directory. All of the files in conf/ won't be overwritten.

Requirements

Linux

You only need wget and tar installed on your node. Your node also needs Internet access for downloading the tarballs from Apache Tomcat and Java Service Wrapper. You can also change overwrite the download URLs to fetch the archives from your local network.

Windows

You need Powershell installed on your node to download and extract the zip-archives. Also download via Internet by default and possibility to overwrite download URLs with your local network URLs.

Usage of this module

! IMPORTANT ! Please make sure the value of tomcat_number is set to "01", "02", "03" and so on. This module needs this number to generate the nessecary ports for every instance and is also naming the appropriate directory like /srv/tomcat/tomcat[number] or C:\Tomcat\tomcat[number]. You can use the optional/additional variable "tomcat_description => 'livesystem'" to define a user-friendly, human-readable and understandable subdiretory like /srv/tomcat/tomcat01_livesystem or C:\Tomcat\Tomcat01_livesystem and also Windows service display name and description.

Linux

Usage in site.pp, two Tomcat instances with possible options, e.g.

   tomcats::windows::install { '01':
      tomcat_number => '01',
      tomcat_release => '8.0.24',
      wrapper_release => '3.5.21',
      java_home => '/usr/lib/jvm/jdk-8-oracle-x64',
      download_tomcat_from => 'http://archive.apache.org',
      download_wrapper_from => 'http://wrapper.tanukisoftware.com/download',
   }

   tomcats::windows::install { '02':
      tomcat_number => '02',
      tomcat_release => '7.0.54',
      wrapper_release => '3.5.21',
      java_home => '/usr/lib/jvm/jdk-7-oracle-x64',
      download_tomcat_from => 'http://archive.apache.org',
      download_wrapper_from => 'http://wrapper.tanukisoftware.com/download',
   }

Usage in your ENC like Foreman

The Foreman will recognize the class instance.pp class and you can override via smart class parameters. Parameters are stored in a hash and you can use YAML to define your options.

   example01:
     tomcat_number: '01'
     tomcat_release: 8.0.24
     java_home: /usr/lib/jvm/jdk-8-oracle-x64
   example02:
     tomcat_number: '02'
     tomcat_release: 7.0.54
     java_home: /usr/lib/jvm/jdk-7-oracle-x64

Windows

Usage in site.pp

Apache Tomcat without any service or wrapper

 tomcats::windows::install { '01':
  tomcat_number           => '01',
  tomcat_release          => '8.0.24',
  parent_inst_dir         => 'C:\Tomcat',
  install_tempdir_windows => 'C:\Windows\Temp',
  download_tomcat_from    => 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24-windows-x64.zip',
  autostart               => false,
}

Apache Tomcat with Yet Another Java Service Wrapper (YAJSW)

tomcats::windows::install { '01':
  tomcat_number           => '01',
  tomcat_release          => '8.0.24',
  parent_inst_dir         => 'C:\Tomcat',
  install_tempdir_windows => 'C:\Windows\Temp',
  download_tomcat_from    => 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24-windows-x64.zip',
  autostart               => false,
  java_home               => 'C:\Java\jdk8',
  wrapper                 => 'yajsw',
  wrapper_release         => '11.11',
  download_wrapper_from   => 'http://downloads.sourceforge.net/project/yajsw/yajsw/yajsw-stable-11.11/yajsw-stable-11.11.zip',
}

Apache Tomcat with Tanuki Java Service Wrapper (JSW)

tomcats::windows::install { '01':
  tomcat_number           => '01',
  tomcat_release          => '8.0.24',
  parent_inst_dir         => 'C:\Tomcat',
  install_tempdir_windows => 'C:\Windows\Temp',
  download_tomcat_from    => 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24-windows-x64.zip',
  autostart               => false,
  java_home               => 'C:\Java\jdk8',
  wrapper                 => 'tanuki',
  wrapper_release         => '3.5.26',
  download_wrapper_from   => 'http://wrapper.tanukisoftware.com/download/3.5.26/wrapper-windows-x86-64-3.5.26-st.zip',
}

Usage in your ENC (Foreman, ...) is like on Linux (see above).

SUPPORTS

Tested on:

  • Debian, Ubuntu
  • Windows Server 2008, Windows Server 2012, Windows 7
  • Should also work on RPM-based distributions (not tested)

Have Fun with this module and give me feedback! ;-)

CopyLeft

Copyleft (C) 2015 Marcel Emmert echomike@gmx.de