Puppet Class: tomcat

Inherits:
tomcat::params
Defined in:
manifests/init.pp

Overview

Class: tomcat

This module installs the Tomcat application server from available repositories or archive

Parameters:

install_from

what type of source to install from (valid: ‘package’|‘archive’)

version

tomcat full version number (valid format: x.y.z)

archive_source

where to download archive from (only if installed from archive)

package_name

tomcat package name

package_ensure

tomcat package ‘ensure’ attribute (falls back to value of ‘$version’)

service_name

tomcat service name

service_ensure

whether the service should be running (valid: ‘stopped’|‘running’)

service_enable

enable service (boolean)

systemd_service_type

value for systemd service type

service_start

override service startup command

service_stop

override service shutdown command

tomcat_user

service user

tomcat_group

service group

file_mode

mode for configuration files

tomcat_native

install tomcat native library (boolean)

tomcat_native_package_name

tomcat native library package name

log4j

install log4j libraries (boolean)

log4j_package_name

log4j package name

extras_enable

install extra libraries (boolean)

extras_source

where to download extra libraries from

extras_package_name

install extras from given package(s)

manage_firewall

manage firewall rules (boolean)

checksum_verify

verify the checksum if tomcat is installed from an archive (boolean)

checksum_type

archive file checksum type (valid: ‘none’|‘md5’|‘sha1’|‘sha2’|‘sh256’|‘sha384’|‘sha512’)

checksum

archive file checksum

admin_webapps

install admin webapps (boolean - only if installed from package)

admin_webapps_package_name

admin webapps package name

create_default_admin

create default admin user (boolean)

admin_user

admin user name

admin_password

admin user password

tomcat_users

hash containing user definitions

tomcat_roles

hash containing role definitions

see README file for a description of all parameters related to server configuration

Actions:

  • Install tomcat

  • Configure main instance

  • Download extra libraries (optional)

Requires:

  • puppetlabs/stdlib module

  • puppetlabs/concat module

Sample Usage:

class { '::tomcat':
  version      => '7.0.56-2ubuntu0.1',
  service_name => 'tomcat7'
}

Parameters:

  • install_from (Any) (defaults to: 'package')
  • version (Any) (defaults to: $::tomcat::params::version)
  • archive_source (Any) (defaults to: undef)
  • package_name (Any) (defaults to: $::tomcat::params::package_name)
  • package_ensure (Any) (defaults to: undef)
  • service_name (Any) (defaults to: undef)
  • service_ensure (Any) (defaults to: 'running')
  • service_enable (Any) (defaults to: true)
  • restart_on_change (Any) (defaults to: true)
  • systemd_service_type (Any) (defaults to: undef)
  • service_start (Any) (defaults to: undef)
  • service_stop (Any) (defaults to: undef)
  • tomcat_user (Any) (defaults to: undef)
  • tomcat_group (Any) (defaults to: undef)
  • file_mode (Any) (defaults to: '0600')
  • tomcat_native (Any) (defaults to: false)
  • tomcat_native_package_name (Any) (defaults to: $::tomcat::params::tomcat_native_package_name)
  • log4j (Any) (defaults to: false)
  • log4j_package_name (Any) (defaults to: $::tomcat::params::log4j_package_name)
  • extras_enable (Any) (defaults to: false)
  • extras_source (Any) (defaults to: undef)
  • extras_package_name (Any) (defaults to: undef)
  • manage_firewall (Any) (defaults to: false)
  • checksum_verify (Any) (defaults to: false)
  • checksum_type (Any) (defaults to: 'none')
  • checksum (Any) (defaults to: undef)
  • admin_webapps (Any) (defaults to: true)
  • admin_webapps_package_name (Any) (defaults to: undef)
  • create_default_admin (Any) (defaults to: false)
  • admin_user (Any) (defaults to: 'tomcatadmin')
  • admin_password (Any) (defaults to: 'password')
  • tomcat_users (Any) (defaults to: {})
  • tomcat_roles (Any) (defaults to: {})
  • log_path (Any) (defaults to: undef)
  • log4j_enable (Any) (defaults to: false)
  • log4j_conf_type (Any) (defaults to: 'ini')
  • log4j_conf_source (Any) (defaults to: "puppet:///modules/${module_name}/log4j/log4j.properties")
  • server_control_port (Any) (defaults to: 8005)
  • server_shutdown (Any) (defaults to: 'SHUTDOWN')
  • server_address (Any) (defaults to: undef)
  • server_params (Any) (defaults to: {})
  • apr_listener (Any) (defaults to: false)
  • apr_sslengine (Any) (defaults to: undef)
  • jmx_listener (Any) (defaults to: false)
  • jmx_registry_port (Any) (defaults to: 8050)
  • jmx_server_port (Any) (defaults to: 8051)
  • jmx_bind_address (Any) (defaults to: '')
  • listeners (Any) (defaults to: [])
  • svc_name (Any) (defaults to: 'Catalina')
  • svc_params (Any) (defaults to: {})
  • threadpool_executor (Any) (defaults to: false)
  • threadpool_name (Any) (defaults to: 'tomcatThreadPool')
  • threadpool_nameprefix (Any) (defaults to: 'catalina-exec-')
  • threadpool_maxthreads (Any) (defaults to: undef)
  • threadpool_minsparethreads (Any) (defaults to: undef)
  • threadpool_params (Any) (defaults to: {})
  • executors (Any) (defaults to: [])
  • http_connector (Any) (defaults to: true)
  • http_port (Any) (defaults to: 8080)
  • http_protocol (Any) (defaults to: undef)
  • http_use_threadpool (Any) (defaults to: false)
  • http_connectiontimeout (Any) (defaults to: undef)
  • http_uriencoding (Any) (defaults to: undef)
  • http_compression (Any) (defaults to: undef)
  • http_maxthreads (Any) (defaults to: undef)
  • http_params (Any) (defaults to: {})
  • ssl_connector (Any) (defaults to: false)
  • ssl_port (Any) (defaults to: 8443)
  • ssl_protocol (Any) (defaults to: undef)
  • ssl_use_threadpool (Any) (defaults to: false)
  • ssl_connectiontimeout (Any) (defaults to: undef)
  • ssl_uriencoding (Any) (defaults to: undef)
  • ssl_compression (Any) (defaults to: false)
  • ssl_maxthreads (Any) (defaults to: undef)
  • ssl_clientauth (Any) (defaults to: undef)
  • ssl_sslenabledprotocols (Any) (defaults to: undef)
  • ssl_sslprotocol (Any) (defaults to: undef)
  • ssl_keystorefile (Any) (defaults to: undef)
  • ssl_params (Any) (defaults to: {})
  • ajp_connector (Any) (defaults to: true)
  • ajp_port (Any) (defaults to: 8009)
  • ajp_protocol (Any) (defaults to: 'AJP/1.3')
  • ajp_use_threadpool (Any) (defaults to: false)
  • ajp_connectiontimeout (Any) (defaults to: undef)
  • ajp_uriencoding (Any) (defaults to: undef)
  • ajp_maxthreads (Any) (defaults to: undef)
  • ajp_params (Any) (defaults to: {})
  • connectors (Any) (defaults to: [])
  • engine_name (Any) (defaults to: 'Catalina')
  • engine_defaulthost (Any) (defaults to: undef)
  • engine_jvmroute (Any) (defaults to: undef)
  • engine_params (Any) (defaults to: {})
  • use_simpletcpcluster (Any) (defaults to: false)
  • cluster_membership_port (Any) (defaults to: '45565')
  • cluster_membership_bind_address (Any) (defaults to: undef)
  • cluster_membership_domain (Any) (defaults to: 'tccluster')
  • cluster_receiver_address (Any) (defaults to: undef)
  • cluster_receiver_port (Any) (defaults to: '4000')
  • cluster_farm_deployer (Any) (defaults to: false)
  • cluster_parent (Any) (defaults to: undef)
  • cluster_farm_deployer_watchdir (Any) (defaults to: undef)
  • cluster_farm_deployer_deploydir (Any) (defaults to: undef)
  • cluster_farm_deployer_watch_enabled (Any) (defaults to: true)
  • combined_realm (Any) (defaults to: false)
  • lockout_realm (Any) (defaults to: true)
  • userdatabase_realm (Any) (defaults to: true)
  • realms (Any) (defaults to: [])
  • host_name (Any) (defaults to: 'localhost')
  • host_appbase (Any) (defaults to: undef)
  • host_autodeploy (Any) (defaults to: undef)
  • host_deployonstartup (Any) (defaults to: undef)
  • host_undeployoldversions (Any) (defaults to: undef)
  • host_unpackwars (Any) (defaults to: undef)
  • host_params (Any) (defaults to: {})
  • singlesignon_valve (Any) (defaults to: false)
  • accesslog_valve (Any) (defaults to: true)
  • valves (Any) (defaults to: [])
  • engine_valves (Any) (defaults to: [])
  • globalnaming_environments (Any) (defaults to: [])
  • globalnaming_resources (Any) (defaults to: [])
  • context_params (Any) (defaults to: {})
  • context_loader (Any) (defaults to: {})
  • context_manager (Any) (defaults to: {})
  • context_realm (Any) (defaults to: {})
  • context_resources (Any) (defaults to: {})
  • context_watchedresources (Any) (defaults to: ['WEB-INF/web.xml',"\${catalina.base}/conf/web.xml"])
  • context_parameters (Any) (defaults to: [])
  • context_environments (Any) (defaults to: [])
  • context_listeners (Any) (defaults to: [])
  • context_valves (Any) (defaults to: [])
  • context_resourcedefs (Any) (defaults to: [])
  • context_resourcelinks (Any) (defaults to: [])
  • default_servlet_debug (Any) (defaults to: 0)
  • default_servlet_listings (Any) (defaults to: false)
  • default_servlet_gzip (Any) (defaults to: undef)
  • default_servlet_input (Any) (defaults to: undef)
  • default_servlet_output (Any) (defaults to: undef)
  • default_servlet_readonly (Any) (defaults to: undef)
  • default_servlet_fileencoding (Any) (defaults to: undef)
  • default_servlet_showserverinfo (Any) (defaults to: undef)
  • default_servlet_params (Any) (defaults to: {})
  • jsp_servlet_checkinterval (Any) (defaults to: undef)
  • jsp_servlet_development (Any) (defaults to: undef)
  • jsp_servlet_enablepooling (Any) (defaults to: undef)
  • jsp_servlet_fork (Any) (defaults to: false)
  • jsp_servlet_genstringaschararray (Any) (defaults to: undef)
  • jsp_servlet_javaencoding (Any) (defaults to: undef)
  • jsp_servlet_modificationtestinterval (Any) (defaults to: undef)
  • jsp_servlet_trimspaces (Any) (defaults to: undef)
  • jsp_servlet_xpoweredby (Any) (defaults to: false)
  • jsp_servlet_params (Any) (defaults to: {})
  • default_servletmapping_urlpatterns (Any) (defaults to: ['/'])
  • jsp_servletmapping_urlpatterns (Any) (defaults to: ['*.jsp', '*.jspx'])
  • sessionconfig_sessiontimeout (Any) (defaults to: 30)
  • welcome_file_list (Any) (defaults to: ['index.html', 'index.htm', 'index.jsp' ])
  • config_path (Any) (defaults to: undef)
  • catalina_home (Any) (defaults to: undef)
  • catalina_base (Any) (defaults to: undef)
  • jasper_home (Any) (defaults to: undef)
  • catalina_tmpdir (Any) (defaults to: undef)
  • catalina_pid (Any) (defaults to: undef)
  • catalina_opts (Any) (defaults to: [])
  • java_home (Any) (defaults to: undef)
  • java_opts (Any) (defaults to: ['-server'])
  • jpda_enable (Any) (defaults to: false)
  • jpda_transport (Any) (defaults to: undef)
  • jpda_address (Any) (defaults to: undef)
  • jpda_suspend (Any) (defaults to: undef)
  • jpda_opts (Any) (defaults to: [])
  • security_manager (Any) (defaults to: false)
  • lang (Any) (defaults to: undef)
  • shutdown_wait (Any) (defaults to: 30)
  • shutdown_verbose (Any) (defaults to: false)
  • custom_variables (Any) (defaults to: {})


92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
# File 'manifests/init.pp', line 92

class tomcat (
  #
  # undef values are automatically generated within the class for convenience reasons
  #
  #..................................................................................
  # packages and service
  #..................................................................................
  $install_from               = 'package',
  $version                    = $::tomcat::params::version,
  $archive_source             = undef,
  $package_name               = $::tomcat::params::package_name,
  $package_ensure             = undef,
  $service_name               = undef,
  $service_ensure             = 'running',
  $service_enable             = true,
  $restart_on_change          = true,
  $systemd_service_type       = undef,
  $service_start              = undef,
  $service_stop               = undef,
  $tomcat_user                = undef,
  $tomcat_group               = undef,
  $file_mode                  = '0600',
  $tomcat_native              = false,
  $tomcat_native_package_name = $::tomcat::params::tomcat_native_package_name,
  $log4j                      = false,
  $log4j_package_name         = $::tomcat::params::log4j_package_name,
  $extras_enable              = false,
  $extras_source              = undef,
  $extras_package_name        = undef,
  $manage_firewall            = false,
  #..................................................................................
  # checksum for archive file
  #..................................................................................
  $checksum_verify            = false,
  $checksum_type              = 'none',
  $checksum                   = undef,
  #..................................................................................
  # security and administration
  #..................................................................................
  $admin_webapps              = true,
  $admin_webapps_package_name = undef,
  $create_default_admin       = false,
  $admin_user                 = 'tomcatadmin',
  $admin_password             = 'password',
  $tomcat_users               = {},
  $tomcat_roles               = {},
  #..................................................................................
  # logging
  #..................................................................................
  $log_path                   = undef,
  $log4j_enable               = false,
  $log4j_conf_type            = 'ini',
  $log4j_conf_source          = "puppet:///modules/${module_name}/log4j/log4j.properties",
  #..................................................................................
  # server configuration
  #..................................................................................
  # server
  $server_control_port        = 8005,
  $server_shutdown            = 'SHUTDOWN',
  $server_address             = undef,
  $server_params              = {},
  #..................................................................................
  # listeners
  $apr_listener               = false,
  $apr_sslengine              = undef,
  # jmx
  $jmx_listener               = false,
  $jmx_registry_port          = 8050,
  $jmx_server_port            = 8051,
  $jmx_bind_address           = '',
  # custom listeners
  $listeners                  = [],
  #..................................................................................
  # service
  $svc_name                   = 'Catalina',
  $svc_params                 = {},
  #..................................................................................
  # executors
  $threadpool_executor        = false,
  $threadpool_name            = 'tomcatThreadPool',
  $threadpool_nameprefix      = 'catalina-exec-',
  $threadpool_maxthreads      = undef,
  $threadpool_minsparethreads = undef,
  $threadpool_params          = {},
  # custom executors
  $executors                  = [],
  #..................................................................................
  # connectors
  # http connector
  $http_connector             = true,
  $http_port                  = 8080,
  $http_protocol              = undef,
  $http_use_threadpool        = false,
  $http_connectiontimeout     = undef,
  $http_uriencoding           = undef,
  $http_compression           = undef,
  $http_maxthreads            = undef,
  $http_params                = {},
  # ssl connector
  $ssl_connector              = false,
  $ssl_port                   = 8443,
  $ssl_protocol               = undef,
  $ssl_use_threadpool         = false,
  $ssl_connectiontimeout      = undef,
  $ssl_uriencoding            = undef,
  $ssl_compression            = false,
  $ssl_maxthreads             = undef,
  $ssl_clientauth             = undef,
  $ssl_sslenabledprotocols    = undef,
  $ssl_sslprotocol            = undef,
  $ssl_keystorefile           = undef,
  $ssl_params                 = {},
  # ajp connector
  $ajp_connector              = true,
  $ajp_port                   = 8009,
  $ajp_protocol               = 'AJP/1.3',
  $ajp_use_threadpool         = false,
  $ajp_connectiontimeout      = undef,
  $ajp_uriencoding            = undef,
  $ajp_maxthreads             = undef,
  $ajp_params                 = {},
  # custom connectors
  $connectors                 = [],
  #..................................................................................
  # engine
  $engine_name                = 'Catalina',
  $engine_defaulthost         = undef,
  $engine_jvmroute            = undef,
  $engine_params              = {},
  #..................................................................................
  # cluster (experimental)
  $use_simpletcpcluster                = false,
  $cluster_membership_port             = '45565',
  $cluster_membership_bind_address     = undef, # useful if there are multiple NICs and multicast isn't using the right one
  $cluster_membership_domain           = 'tccluster',
  $cluster_receiver_address            = undef,
  $cluster_receiver_port               = '4000',
  $cluster_farm_deployer               = false,
  $cluster_parent                      = undef, # engine/host, must be 'host' if using farm deployer
  $cluster_farm_deployer_watchdir      = undef,
  $cluster_farm_deployer_deploydir     = undef, # directory not managed by this module
  $cluster_farm_deployer_watch_enabled = true,
  #..................................................................................
  # realms
  $combined_realm             = false,
  $lockout_realm              = true,
  $userdatabase_realm         = true,
  $realms                     = [],
  #..................................................................................
  # host
  $host_name                  = 'localhost',
  $host_appbase               = undef,
  $host_autodeploy            = undef,
  $host_deployonstartup       = undef,
  $host_undeployoldversions   = undef,
  $host_unpackwars            = undef,
  $host_params                = {},
  #..................................................................................
  # host valves
  $singlesignon_valve         = false,
  $accesslog_valve            = true,
  $valves                     = [],
  # engine valves
  $engine_valves              = [],
  #..................................................................................
  # misc
  $globalnaming_environments  = [],
  $globalnaming_resources     = [],
  #..................................................................................
  # context configuration
  #..................................................................................
  $context_params             = {},
  $context_loader             = {},
  $context_manager            = {},
  $context_realm              = {},
  $context_resources          = {},
  $context_watchedresources   = ['WEB-INF/web.xml',"\${catalina.base}/conf/web.xml"],
  $context_parameters         = [],
  $context_environments       = [],
  $context_listeners          = [],
  $context_valves             = [],
  $context_resourcedefs       = [],
  $context_resourcelinks      = [],
  #..................................................................................
  # web apps configuration
  #..................................................................................
  # servlets
  $default_servlet_debug                = 0,
  $default_servlet_listings             = false,
  $default_servlet_gzip                 = undef,
  $default_servlet_input                = undef,
  $default_servlet_output               = undef,
  $default_servlet_readonly             = undef,
  $default_servlet_fileencoding         = undef,
  $default_servlet_showserverinfo       = undef,
  $default_servlet_params               = {},
  $jsp_servlet_checkinterval            = undef,
  $jsp_servlet_development              = undef,
  $jsp_servlet_enablepooling            = undef,
  $jsp_servlet_fork                     = false,
  $jsp_servlet_genstringaschararray     = undef,
  $jsp_servlet_javaencoding             = undef,
  $jsp_servlet_modificationtestinterval = undef,
  $jsp_servlet_trimspaces               = undef,
  $jsp_servlet_xpoweredby               = false,
  $jsp_servlet_params                   = {},
  #..................................................................................
  # servlet-mappings
  $default_servletmapping_urlpatterns   = ['/'],
  $jsp_servletmapping_urlpatterns       = ['*.jsp', '*.jspx'],
  #..................................................................................
  # session-config
  $sessionconfig_sessiontimeout         = 30,
  #..................................................................................
  # welcome-file-list
  $welcome_file_list                    = ['index.html', 'index.htm', 'index.jsp' ],
  #..................................................................................
  # environment variables
  #..................................................................................
  $config_path                = undef,
  # catalina
  $catalina_home              = undef,
  $catalina_base              = undef,
  $jasper_home                = undef,
  $catalina_tmpdir            = undef,
  $catalina_pid               = undef,
  $catalina_opts              = [],
  # java
  $java_home                  = undef,
  $java_opts                  = ['-server'],
  # debug
  $jpda_enable                = false,
  $jpda_transport             = undef,
  $jpda_address               = undef,
  $jpda_suspend               = undef,
  $jpda_opts                  = [],
  # other
  $security_manager           = false,
  $lang                       = undef,
  $shutdown_wait              = 30,
  $shutdown_verbose           = false,
  $custom_variables           = {}) inherits tomcat::params {
  # parameters validation
  if $install_from !~ /^(package|archive)$/ {
    fail('$install_from must be either \'package\' or \'archive\'')
  }
  if $version !~ /^(?:[0-9]{1,2}:)?[0-9]\.[0-9]\.[0-9]{1,2}(?:-.*)?$/ {
    fail('incorrect tomcat version number')
  }
  if $service_ensure !~ /^(stopped|running)$/ {
    fail('$service_ensure must be either \'stopped\' or \'running\'')
  }
  if $checksum_type !~ /^(none|md5|sha1|sha2|sh256|sha384|sha512)$/ {
    fail('$checksum can only be one of: none|md5|sha1|sha2|sh256|sha384|sha512')
  }
  if $checksum_verify and !$checksum {
    fail('Checksum verification requires $checksum variable to be set')
  }

  # split version string
  $array_version_full = split($version, '[-]')
  $version_real = regsubst($array_version_full[0], '[0-9]{1,2}:', '')
  $array_version_real = split($version_real, '[.]')
  $maj_version = $array_version_real[0]

  # autogenerated defaults
  if $service_name == undef {
    $service_name_real = $install_from ? {
      'package' => $package_name,
      default   => "tomcat${maj_version}"
    } } else {
    $service_name_real = $service_name
  }

  if $archive_source == undef {
    $archive_source_real = "http://archive.apache.org/dist/tomcat/tomcat-${maj_version}/v${version_real}/bin/apache-tomcat-${version_real}.tar.gz"
  } else {
    $archive_source_real = $archive_source
  }

  if $extras_source == undef {
    $extras_source_real = "http://archive.apache.org/dist/tomcat/tomcat-${maj_version}/v${version_real}/bin/extras"
  } else {
    $extras_source_real = $extras_source
  }

  if $admin_webapps_package_name == undef {
    $admin_webapps_package_name_real = $::osfamily ? {
      'Debian' => "${package_name}-admin",
      default  => "${package_name}-admin-webapps"
    } } else {
    $admin_webapps_package_name_real = $admin_webapps_package_name
  }

  if $catalina_home == undef {
    $catalina_home_real = "/usr/share/${service_name_real}"
  } else {
    $catalina_home_real = $catalina_home
  }

  if $catalina_base == undef {
    case $install_from {
      'package' : {
        $catalina_base_real = $::osfamily ? {
          'Debian' => "/var/lib/${service_name_real}",
          default  => $catalina_home_real
        } }
      default   : {
        $catalina_base_real = $catalina_home_real
      }
    }
  } else {
    $catalina_base_real = $catalina_base
  }

  if $jasper_home == undef {
    $jasper_home_real = $catalina_home_real
  } else {
    $jasper_home_real = $jasper_home
  }

  if $catalina_tmpdir == undef {
    case $install_from {
      'package' : {
        $catalina_tmpdir_real = $::osfamily ? {
          'Debian' => '$JVM_TMP',
          default  => "${catalina_base_real}/temp"
        } }
      default   : {
        $catalina_tmpdir_real = "${catalina_base_real}/temp"
      }
    }
  } else {
    $catalina_tmpdir_real = $catalina_tmpdir
  }

  if $catalina_pid == undef {
    case $install_from {
      'package' : {
        $catalina_pid_real = "/var/run/${service_name_real}.pid"
      }
      default   : {
        $catalina_pid_real = "/var/run/${service_name_real}/${service_name_real}.pid"
      }
    }
  } else {
    $catalina_pid_real = $catalina_pid
  }

  if $package_ensure {
    if $package_ensure !~ /^(latest|present)$/ {
      fail('$package_ensure must be either \'latest\' or \'present\'')
    }
    $package_ensure_real = $package_ensure
  } else {
    $package_ensure_real = $version
  }

  if $log_path == undef {
    $log_path_real = "/var/log/${service_name_real}"
  } else {
    $log_path_real = $log_path
  }

  if $config_path == undef {
    case $install_from {
      'package' : {
        $config_path_real = $::osfamily ? {
          'Debian' => "/etc/default/${service_name_real}",
          'Suse'   => "/etc/${service_name_real}/${service_name_real}.conf",
          default  => "/etc/sysconfig/${service_name_real}"
        } }
      default   : {
        $config_path_real = "${catalina_base_real}/bin/setenv.sh"
      }
    }
  } else {
    $config_path_real = $config_path
  }

  if $systemd_service_type == undef {
    if $install_from == 'archive' {
      $systemd_service_type_real = 'forking'
    } else {
      $systemd_service_type_real = 'simple'
    }
  } else {
    $systemd_service_type_real = $systemd_service_type
  }

  if $service_start == undef {
    # unused with $install_from == 'package'
    $start_cmd = $jpda_enable ? {
      true    => 'jpda start',
      default => 'start'
    }
    # catalina.sh in archive for takes -security option to enable security manager
    $security_arg = $security_manager ? {
      true    => ' -security',
      default => ''
    }
    $service_start_real = "${catalina_home_real}/bin/catalina.sh ${start_cmd}${security_arg}"
  } else {
    $service_start_real = $service_start
  }

  if $service_stop == undef {
    case $install_from {
      'package' : { $service_stop_real = '/usr/sbin/tomcat-sysd stop' }
      default   : { $service_stop_real = "${catalina_home_real}/bin/catalina.sh stop" }
    }
  } else {
    $service_stop_real = $service_stop
  }

  if $tomcat_user == undef {
    case $install_from {
      'package' : {
        $tomcat_user_real = $::osfamily ? {
          'Debian' => $service_name_real,
          default  => 'tomcat'
        } }
      default   : {
        $tomcat_user_real = 'tomcat'
      }
    }
  } else {
    $tomcat_user_real = $tomcat_user
  }

  if $tomcat_group == undef {
    $tomcat_group_real = $tomcat_user_real
  } else {
    $tomcat_group_real = $tomcat_group
  }

  if $::osfamily == 'Debian' {
    $security_manager_real = $security_manager ? {
      true    => 'yes',
      default => 'no'
    } } else {
    $security_manager_real = $security_manager
  }

  $engine_defaulthost_real = $engine_defaulthost ? {
    undef   => $host_name,
    default => $engine_defaulthost
  }

  $java_opts_real = join($java_opts, ' ')
  $catalina_opts_real = join($catalina_opts, ' ')
  $jpda_opts_real = join($jpda_opts, ' ')

  # generate params hash
  $server_params_real = merge(delete_undef_values({
    'port'     => $server_control_port,
    'shutdown' => $server_shutdown,
    'address'  => $server_address
  }
  ), $server_params)

  $svc_params_real = merge(delete_undef_values({
    'name' => $svc_name
  }
  ), $svc_params)

  $threadpool_params_real = merge(delete_undef_values({
    'namePrefix'      => $threadpool_nameprefix,
    'maxThreads'      => $threadpool_maxthreads,
    'minSpareThreads' => $threadpool_minsparethreads
  }
  ), $threadpool_params)

  $http_params_real = merge(delete_undef_values({
    'protocol'          => $http_protocol,
    'executor'          => $http_use_threadpool ? {
      true    => $threadpool_name,
      default => undef
    },
    'connectionTimeout' => $http_connectiontimeout,
    'URIEncoding'       => $http_uriencoding,
    'compression'       => $http_compression ? {
      true    => 'on',
      default => undef
    },
    'maxThreads'        => $http_maxthreads
  }
  ), $http_params)

  $ssl_params_real = merge(delete_undef_values({
    'protocol'            => $ssl_protocol,
    'executor'            => $ssl_use_threadpool ? {
      true    => $threadpool_name,
      default => undef
    },
    'connectionTimeout'   => $ssl_connectiontimeout,
    'URIEncoding'         => $ssl_uriencoding,
    'compression'         => $ssl_compression ? {
      true    => 'on',
      default => undef
    },
    'maxThreads'          => $ssl_maxthreads,
    'clientAuth'          => $ssl_clientauth,
    'sslEnabledProtocols' => $ssl_sslenabledprotocols,
    'sslProtocol'         => $ssl_sslprotocol,
    'keystoreFile'        => $ssl_keystorefile
  }
  ), $ssl_params)

  $ajp_params_real = merge(delete_undef_values({
    'executor'          => $ajp_use_threadpool ? {
      true    => $threadpool_name,
      default => undef
    },
    'connectionTimeout' => $ajp_connectiontimeout,
    'URIEncoding'       => $ajp_uriencoding,
    'maxThreads'        => $ajp_maxthreads
  }
  ), $ajp_params)

  $engine_params_real = merge(delete_undef_values({
    'name'        => $engine_name,
    'defaultHost' => $engine_defaulthost_real,
    'jvmRoute'    => $engine_jvmroute
  }
  ), $engine_params)

  $host_params_real = merge(delete_undef_values({
    'appBase'             => $host_appbase,
    'autoDeploy'          => $host_autodeploy,
    'deployOnStartup'     => $host_deployonstartup,
    'undeployOldVersions' => $host_undeployoldversions,
    'unpackWARs'          => $host_unpackwars
  }
  ), $host_params)

  $default_servlet_params_real = merge(delete_undef_values({
    'debug'          => $default_servlet_debug,
    'listings'       => $default_servlet_listings,
    'gzip'           => $default_servlet_gzip,
    'input'          => $default_servlet_input,
    'output'         => $default_servlet_output,
    'readonly'       => $default_servlet_readonly,
    'fileEncoding'   => $default_servlet_fileencoding,
    'showServerInfo' => $default_servlet_showserverinfo
  }
  ), $default_servlet_params)

  $jsp_servlet_params_real = merge(delete_undef_values({
    'checkInterval'            => $jsp_servlet_checkinterval,
    'development'              => $jsp_servlet_development,
    'enablePooling'            => $jsp_servlet_enablepooling,
    'fork'                     => $jsp_servlet_fork,
    'genStringAsCharArray'     => $jsp_servlet_genstringaschararray,
    'javaEncoding'             => $jsp_servlet_javaencoding,
    'modificationTestInterval' => $jsp_servlet_modificationtestinterval,
    'trimSpaces'               => $jsp_servlet_trimspaces,
    'xpoweredBy'               => $jsp_servlet_xpoweredby
  }
  ), $jsp_servlet_params)

  # should we force download extras libs?
  if $log4j_enable or $jmx_listener {
    $extras_enable_real = true
  } else {
    $extras_enable_real = $extras_enable
  }

  # cluster can live in engine or host, engine was original default, host is required if using farm deployer
  if $cluster_parent {
    if $cluster_parent !~ /^(engine|host)$/ {
      fail('$cluster_parent must be either \'host\' or \'engine\'')
    }
    if $cluster_farm_deployer and $cluster_parent == 'engine' {
      fail('Farm deployer cannot be used with $cluster_parent=\'engine\'')
    }
    $cluster_parent_real = $cluster_parent
  } else {
    $cluster_parent_real = $cluster_farm_deployer ? { true => 'host', default => 'engine' }
  }
  # default name for watchdir is "deploy" b/c you put WAR there to deploy it
  # deploydir (typically webapps) is where files are deployed to
  $cluster_farm_deployer_watchdir_real = pick($cluster_farm_deployer_watchdir,"${catalina_base_real}/deploy")
  $cluster_farm_deployer_deploydir_real = pick($cluster_farm_deployer_deploydir, "${catalina_base_real}/webapps")

  # start the real action
  contain tomcat::install
  contain tomcat::service
  contain tomcat::config
  Class['::tomcat::install'] -> Class['::tomcat::config'] -> Class['::tomcat::service']

  if $log4j_enable {
    contain tomcat::log4j
    Class['::tomcat::install'] -> Class['::tomcat::log4j'] -> Class['::tomcat::service']
  }

  if $extras_enable_real and !$extras_package_name {
    # download and install extras from archive
    contain tomcat::extras
    Class['::tomcat::install'] -> Class['::tomcat::extras'] -> Class['::tomcat::service']
  }

  if $manage_firewall {
    contain tomcat::firewall
  }
}