Puppet Class: apache::mod::jk
- Defined in:
- manifests/mod/jk.pp
Summary
Installs `mod_jk`.Overview
shm_file and log_file Depending on how these files are specified, the class creates their final path differently:
Relative path: prepends supplied path with logroot (see below) Absolute path or pipe: uses supplied path as-is
“‘ shm_file => ’shm_file’ # Ends up in $shm_path = ‘/var/log/httpd/shm_file’
shm_file => ‘/run/shm_file’ # Ends up in $shm_path = ‘/run/shm_file’
shm_file => ‘“|rotatelogs /var/log/httpd/mod_jk.log.%Y%m%d 86400 -180”’ # Ends up in $shm_path = ‘“|rotatelogs /var/log/httpd/mod_jk.log.%Y%m%d 86400 -180”’ “‘
All parameters are optional. When undefined, some receive default values, while others cause an optional directive to be absent
Additionally, There is no official package available for mod_jk and thus it must be made available by means outside of the control of the apache module. Binaries can be found at Apache Tomcat Connectors download page
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 |
# File 'manifests/mod/jk.pp', line 272
class apache::mod::jk (
# Binding to mod_jk
Optional[Stdlib::IP::Address] $ip = undef,
Stdlib::Port $port = 80,
Boolean $add_listen = true,
# Conf file content
Optional[String] $workers_file = undef,
Hash $worker_property = {},
Optional[Stdlib::Absolutepath] $logroot = undef,
String $shm_file = 'jk-runtime-status',
Optional[String] $shm_size = undef,
Optional[String] $mount_file = undef,
Optional[String] $mount_file_reload = undef,
Hash $mount = {},
Hash $un_mount = {},
Optional[String] $auto_alias = undef,
Optional[String] $mount_copy = undef,
Optional[String] $worker_indicator = undef,
Optional[Integer] $watchdog_interval = undef,
String $log_file = 'mod_jk.log',
Optional[String] $log_level = undef,
Optional[String] $log_stamp_format = undef,
Optional[String] $request_log_format = undef,
Optional[String] $extract_ssl = undef,
Optional[String] $https_indicator = undef,
Optional[String] $sslprotocol_indicator = undef,
Optional[String] $certs_indicator = undef,
Optional[String] $cipher_indicator = undef,
Optional[String] $certchain_prefix = undef,
Optional[String] $session_indicator = undef,
Optional[String] $keysize_indicator = undef,
Optional[String] $local_name_indicator = undef,
Optional[String] $ignore_cl_indicator = undef,
Optional[String] $local_addr_indicator = undef,
Optional[String] $local_port_indicator = undef,
Optional[String] $remote_host_indicator = undef,
Optional[String] $remote_addr_indicator = undef,
Optional[String] $remote_port_indicator = undef,
Optional[String] $remote_user_indicator = undef,
Optional[String] $auth_type_indicator = undef,
Array $options = [],
Hash $env_var = {},
Optional[String] $strip_session = undef,
# Location list
# See comments in template mod/jk.conf.erb
Array $location_list = [],
# Workers file content
# See comments in template mod/jk/workers.properties.erb
Hash $workers_file_content = {},
# Mount file content
# See comments in template mod/jk/uriworkermap.properties.erb
Hash $mount_file_content = {},
) {
# Provides important variables
include apache
# Manages basic module config
::apache::mod { 'jk': }
# Ensure that we are not using variables with the typo fixed by MODULES-6225
# anymore:
if !empty($workers_file_content) and has_key($workers_file_content, 'worker_mantain') {
fail('Please replace $workers_file_content[\'worker_mantain\'] by $workers_file_content[\'worker_maintain\']. See MODULES-6225 for details.')
}
# Binding to mod_jk
if $add_listen {
$_ip = $ip ? {
undef => $facts['networking']['ip'],
default => $ip,
}
ensure_resource('apache::listen', "${_ip}:${port}", {})
}
# File resource common parameters
File {
ensure => file,
mode => $apache::file_mode,
notify => Class['apache::service'],
}
# Shared memory and log paths
# If logroot unspecified, use default
$log_dir = $logroot ? {
undef => $apache::logroot,
default => $logroot,
}
# If absolute path or pipe, use as-is
# If relative path, prepend with log directory
# If unspecified, use default
$shm_path = $shm_file ? {
undef => "${log_dir}/jk-runtime-status",
/^\"?[|\/]/ => $shm_file,
default => "${log_dir}/${shm_file}",
}
$log_path = $log_file ? {
undef => "${log_dir}/mod_jk.log",
/^\"?[|\/]/ => $log_file,
default => "${log_dir}/${log_file}",
}
# Main config file
$mod_dir = $apache::mod_dir
file { 'jk.conf':
path => "${mod_dir}/jk.conf",
content => template('apache/mod/jk.conf.erb'),
require => [
Exec["mkdir ${mod_dir}"],
File[$mod_dir],
],
}
# Workers file
if $workers_file != undef {
$workers_path = $workers_file ? {
/^\// => $workers_file,
default => "${apache::httpd_dir}/${workers_file}",
}
file { $workers_path:
content => template('apache/mod/jk/workers.properties.erb'),
require => Package['httpd'],
}
}
# Mount file
if $mount_file != undef {
$mount_path = $mount_file ? {
/^\// => $mount_file,
default => "${apache::httpd_dir}/${mount_file}",
}
file { $mount_path:
content => template('apache/mod/jk/uriworkermap.properties.erb'),
require => Package['httpd'],
}
}
}
|