Puppet Class: tomcat

Defined in:
modules/tomcat/manifests/init.pp

Overview

Parameters:

  • hostname (Stdlib::Host) (defaults to: 'localhost')
  • user (String[1]) (defaults to: 'tomcat')
  • group (String[1]) (defaults to: 'tomcat')
  • app_base (String) (defaults to: 'webapps')
  • unpack_wars (Boolean) (defaults to: true)
  • auto_deploy (Boolean) (defaults to: true)
  • connector_port (Stdlib::Port) (defaults to: 8080)
  • connector_timeout (Integer) (defaults to: 20000)
  • config_basedir (Stdlib::Unixpath) (defaults to: '/etc/tomcat9')
  • versionlogger_listener (Boolean) (defaults to: true)
  • security_listener (Boolean) (defaults to: false)
  • apr_listener (Boolean) (defaults to: false)
  • apr_sslengine (Boolean) (defaults to: false)
  • userdatabase_realm (Boolean) (defaults to: false)
  • userdatabase_file (String[1]) (defaults to: 'tomcat-users.xml')
  • logs_dir (String[1]) (defaults to: 'logs')
  • log_pattern (String[1]) (defaults to: 'combined')
  • default_session_timeout (Integer[1]) (defaults to: 30)
  • default_servlet_debug (Boolean) (defaults to: false)
  • default_servlet_listings (Boolean) (defaults to: false)
  • default_servlet_readonly (Boolean) (defaults to: true)
  • default_servlet_mappings (Array[String[1]]) (defaults to: ['/'])
  • jsp_servlet_fork (Boolean) (defaults to: false)
  • jsp_servlet_xpoweredby (Boolean) (defaults to: false)
  • jsp_servlet_mappings (Array[String[1]]) (defaults to: ['*.jsp', '*.jspx'])
  • welcome_files (Array[String[1]]) (defaults to: ['index.html', 'index.htm', 'index.jsp'])
  • shutdown_address (Stdlib::Host) (defaults to: 'localhost')
  • shutdown_string (String) (defaults to: 'SHUTDOWN')
  • watched_resources (Array[String[1]]) (defaults to: ['WEB-INF/web.xml', 'WEB-INF/tomcat-web.xml', # lint:ignore:single_quote_string_with_variables '${catalina.base}/conf/web.xml'])
  • shutdown_port (Optional[Stdlib::Port]) (defaults to: undef)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'modules/tomcat/manifests/init.pp', line 2

class tomcat (
    Stdlib::Host           $hostname                 = 'localhost',
    String[1]              $user                     = 'tomcat',
    String[1]              $group                    = 'tomcat',
    String                 $app_base                 = 'webapps',
    Boolean                $unpack_wars              = true,
    Boolean                $auto_deploy              = true,
    Stdlib::Port           $connector_port           = 8080,
    Integer                $connector_timeout        = 20000,
    Stdlib::Unixpath       $config_basedir           = '/etc/tomcat9',
    Boolean                $versionlogger_listener   = true,
    Boolean                $security_listener        = false,
    Boolean                $apr_listener             = false,
    Boolean                $apr_sslengine            = false,
    Boolean                $userdatabase_realm       = false,
    String[1]              $userdatabase_file        = 'tomcat-users.xml',
    String[1]              $logs_dir                 = 'logs',
    String[1]              $log_pattern              = 'combined',
    Integer[1]             $default_session_timeout  = 30,
    Boolean                $default_servlet_debug    = false,
    Boolean                $default_servlet_listings = false,
    Boolean                $default_servlet_readonly = true,
    Array[String[1]]       $default_servlet_mappings = ['/'],
    Boolean                $jsp_servlet_fork         = false,
    Boolean                $jsp_servlet_xpoweredby   = false,
    Array[String[1]]       $jsp_servlet_mappings     = ['*.jsp', '*.jspx'],
    Array[String[1]]       $welcome_files            = ['index.html', 'index.htm', 'index.jsp'],
    Stdlib::Host           $shutdown_address         = 'localhost',
    String                 $shutdown_string          = 'SHUTDOWN',
    Array[String[1]]       $watched_resources        = ['WEB-INF/web.xml',
                                                        'WEB-INF/tomcat-web.xml',
    # lint:ignore:single_quote_string_with_variables
                                                        '${catalina.base}/conf/web.xml'],
    # lint:endignore
    Optional[Stdlib::Port] $shutdown_port           = undef,
){
    ensure_packages(['tomcat9'])
    file{
        default:
            ensure => file,
            owner  => 'root',
            mode   => '0640',
            group  => $group,
            notify => Service['tomcat9'];
        $config_basedir:
            ensure => directory;
        "${config_basedir}/server.xml":
            content => template('tomcat/server.xml.erb');
        "${config_basedir}/context.xml":
            content => template('tomcat/context.xml.erb');
        "${config_basedir}/web.xml":
            content => template('tomcat/web.xml.erb');
    }
    service{'tomcat9':
        ensure => 'running',
        enable => true,
    }
}