tomcat6

Installs and Manages Tomcat6

Manaaki Whenua

landcareresearch

11,081 downloads

11,081 latest version

2.9 quality score

Version information

  • 0.1.3 (latest)
released Mar 3rd 2015
This version is compatible with:
  • Ubuntu

Start using this module

Documentation

landcareresearch/tomcat6 — version 0.1.3 Mar 3rd 2015

Tomcat6 puppet module

Puppet Forge Bitbucket Build Status

About

This module installs, configures, and manages Apache Tomcat6. Note, uses the system's default version of java.

Requirements

Note, the puppet packages below should automatically be installed if the puppet module command is used.

  • Ubuntu Operating System.
  • Depedencies listed in the Modulefile.

Configuration

There is one class that needs to be declared. The class installs and manages a single instance of tomcat6. The tomcat6 class is a paramaterized class with 1 optional paramater. There is one defined type called tomcat6::app. The tomcat6::app defines a webapp to be installed into the typical webapp directory of tomcat.

Tomcat6 Optional Parameter

The parameters listed in this section can optionally be configured.

resources

Tomcat6 static resources defined in the context.xml file. More details about the configuraiton can be found here. This variable is an array of hashes. Valid hash values defined below.

  • name
  • auth
  • type
  • driverClassName
  • url
  • username
  • password
  • maxActive
  • minIdle
  • maxIdle
  • maxWait
  • minEvictableIdleTimeMillis
  • timeBetweenEvictionRunsMillis
  • numTestsPerEvictionRun
  • poolPreparedStatements
  • maxOpenPreparedStatements
  • testOnBorrow
  • accessToUnderlyingConnectionAllowed
  • validationQuery

Usage

This section shows example uses of the tomcat6 module.

Example 1

This example demonstrates the most basic usage of the tomcat6 module. Deploys tomcat6 with the default configuration.

class {'tomcat6': }

Example 2

This example demonstrates a static resource type configured for a web app called pidsvc.

Declaring a hash for the static resource.

$tomcat_resources = {
    pidsvc => {
        'name' => 'jdbc/pidsvc',
        'auth' => 'Container',
        'type' => 'javax.sql.DataSource',
        'driverClassName' => 'org.postgresql.Driver',
        'url' => "jdbc:postgresql://$pidservice::servername:5432/pidsvc",
        'username' => "$pidservice::db_user",
        'password' => "$pidservice::db_passwd",
        'maxActive' => '-1',
        'minIdle' => '0',
        'maxIdle' => '10',
        'maxWait' => '10000',
        'minEvictableIdleTimeMillis' => '300000',
        'timeBetweenEvictionRunsMillis' => '300000',
        'numTestsPerEvictionRun' => '20',
        'poolPreparedStatements' => 'true',
        'maxOpenPreparedStatements' => '100',
        'testOnBorrow' => 'true',
        'accessToUnderlyingConnectionAllowed' => 'true',
        'validationQuery' => 'SELECT VERSION();'
    }
}

Declaring tomcat6 with the resoures.

class { 'tomcat6': 
    resources => $tomcat_resources,
}

Declaring an app that eventually utilizes the static resource.

tomcat6::app{'pidsvc':
    war_url => 'https://cgsrv1.arrc.csiro.au/swrepo/PidService/jenkins/trunk/pidsvc-latest.war',
    jar_lib_url => 'http://jdbc.postgresql.org/download/postgresql-9.3-1100.jdbc4.jar',
}

Limitations

Only works with debian based OS's.

Development

The module is open source and available on github. Please fork!