Puppet Class: apache::mod::jk

Defined in:
manifests/mod/jk.pp

Overview

Class apache::mod::jk

Manages mod_jk connector

All parameters are optional. When undefined, some receive default values, while others cause an optional directive to be absent

For help on parameters, pls see official reference at: tomcat.apache.org/connectors-doc/reference/apache.html

Parameters:

  • ip (Optional[String]) (defaults to: undef)
  • port (Integer) (defaults to: 80)
  • add_listen (Boolean) (defaults to: true)
  • workers_file (Any) (defaults to: undef)
  • worker_property (Any) (defaults to: {})
  • logroot (Any) (defaults to: undef)
  • shm_file (Any) (defaults to: 'jk-runtime-status')
  • shm_size (Any) (defaults to: undef)
  • mount_file (Any) (defaults to: undef)
  • mount_file_reload (Any) (defaults to: undef)
  • mount (Any) (defaults to: {})
  • un_mount (Any) (defaults to: {})
  • auto_alias (Any) (defaults to: undef)
  • mount_copy (Any) (defaults to: undef)
  • worker_indicator (Any) (defaults to: undef)
  • watchdog_interval (Any) (defaults to: undef)
  • log_file (Any) (defaults to: 'mod_jk.log')
  • log_level (Any) (defaults to: undef)
  • log_stamp_format (Any) (defaults to: undef)
  • request_log_format (Any) (defaults to: undef)
  • extract_ssl (Any) (defaults to: undef)
  • https_indicator (Any) (defaults to: undef)
  • sslprotocol_indicator (Any) (defaults to: undef)
  • certs_indicator (Any) (defaults to: undef)
  • cipher_indicator (Any) (defaults to: undef)
  • certchain_prefix (Any) (defaults to: undef)
  • session_indicator (Any) (defaults to: undef)
  • keysize_indicator (Any) (defaults to: undef)
  • local_name_indicator (Any) (defaults to: undef)
  • ignore_cl_indicator (Any) (defaults to: undef)
  • local_addr_indicator (Any) (defaults to: undef)
  • local_port_indicator (Any) (defaults to: undef)
  • remote_host_indicator (Any) (defaults to: undef)
  • remote_addr_indicator (Any) (defaults to: undef)
  • remote_port_indicator (Any) (defaults to: undef)
  • remote_user_indicator (Any) (defaults to: undef)
  • auth_type_indicator (Any) (defaults to: undef)
  • options (Any) (defaults to: [])
  • env_var (Any) (defaults to: {})
  • strip_session (Any) (defaults to: undef)
  • location_list (Any) (defaults to: [])
  • workers_file_content (Any) (defaults to: {})
  • mount_file_content (Any) (defaults to: {})


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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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
# File 'manifests/mod/jk.pp', line 11

class apache::mod::jk (
  # Binding to mod_jk
  Optional[String] $ip         = undef,
  Integer          $port       = 80,
  Boolean          $add_listen = true,
  # Conf file content
  $workers_file                = undef,
  $worker_property             = {},
  $logroot                     = undef,
  $shm_file                    = 'jk-runtime-status',
  $shm_size                    = undef,
  $mount_file                  = undef,
  $mount_file_reload           = undef,
  $mount                       = {},
  $un_mount                    = {},
  $auto_alias                  = undef,
  $mount_copy                  = undef,
  $worker_indicator            = undef,
  $watchdog_interval           = undef,
  $log_file                    = 'mod_jk.log',
  $log_level                   = undef,
  $log_stamp_format            = undef,
  $request_log_format          = undef,
  $extract_ssl                 = undef,
  $https_indicator             = undef,
  $sslprotocol_indicator       = undef,
  $certs_indicator             = undef,
  $cipher_indicator            = undef,
  $certchain_prefix            = undef,
  $session_indicator           = undef,
  $keysize_indicator           = undef,
  $local_name_indicator        = undef,
  $ignore_cl_indicator         = undef,
  $local_addr_indicator        = undef,
  $local_port_indicator        = undef,
  $remote_host_indicator       = undef,
  $remote_addr_indicator       = undef,
  $remote_port_indicator       = undef,
  $remote_user_indicator       = undef,
  $auth_type_indicator         = undef,
  $options                     = [],
  $env_var                     = {},
  $strip_session               = undef,
  # Location list
  # See comments in template mod/jk.conf.erb
  $location_list               = [],
  # Workers file content
  # See comments in template mod/jk/workers.properties.erb
  $workers_file_content        = {},
  # Mount file content
  # See comments in template mod/jk/uriworkermap.properties.erb
  $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['ipaddress'],
      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'],
    }
  }

}