Puppet Class: apache::mod::cluster

Defined in:
manifests/mod/cluster.pp

Summary

Installs `mod_cluster`.

Overview

Note:

There is no official package available for mod_cluster, so you must make it available outside of the apache module. Binaries can be found [here](modcluster.io/).

Examples:

class { '::apache::mod::cluster':
  ip                      => '172.17.0.1',
  allowed_network         => '172.17.0.',
  balancer_name           => 'mycluster',
  version                 => '1.3.1'
}

Parameters:

  • allowed_network (String)

    Balanced members network.

  • balancer_name (String)

    Name of balancer.

  • ip (Stdlib::IP::Address)

    Specifies the IP address to listen to.

  • version (String)

    Specifies the mod_cluster version. Version 1.3.0 or greater is required for httpd 2.4.

  • enable_mcpm_receive (Boolean) (defaults to: true)

    Whether MCPM should be enabled.

  • port (Stdlib::Port) (defaults to: 6666)

    mod_cluster listen port.

  • keep_alive_timeout (Integer) (defaults to: 60)

    Specifies how long Apache should wait for a request, in seconds.

  • manager_allowed_network (Stdlib::IP::Address) (defaults to: '127.0.0.1')

    Whether to allow the network to access the mod_cluster_manager.

  • max_keep_alive_requests (Integer) (defaults to: 0)

    Maximum number of requests kept alive.

  • server_advertise (Boolean) (defaults to: true)

    Whether the server should advertise.

  • advertise_frequency (Optional[String]) (defaults to: undef)

    Sets the interval between advertise messages in seconds.

See Also:



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
# File 'manifests/mod/cluster.pp', line 51

class apache::mod::cluster (
  String $allowed_network,
  String $balancer_name,
  Stdlib::IP::Address $ip,
  String $version,
  Boolean $enable_mcpm_receive                 = true,
  Stdlib::Port $port                           = 6666,
  Integer $keep_alive_timeout                  = 60,
  Stdlib::IP::Address $manager_allowed_network = '127.0.0.1',
  Integer $max_keep_alive_requests             = 0,
  Boolean $server_advertise                    = true,
  Optional[String] $advertise_frequency        = undef,
) {
  include apache

  ::apache::mod { 'proxy': }
  ::apache::mod { 'proxy_ajp': }
  ::apache::mod { 'manager': }
  ::apache::mod { 'proxy_cluster': }
  ::apache::mod { 'advertise': }

  if (versioncmp($version, '1.3.0') >= 0 ) {
    ::apache::mod { 'cluster_slotmem': }
  } else {
    ::apache::mod { 'slotmem': }
  }

  $parameters = {
    'ip'                      => $ip,
    'port'                    => $port,
    'allowed_network'         => $allowed_network,
    'keep_alive_timeout'      => $keep_alive_timeout,
    'max_keep_alive_requests' => $max_keep_alive_requests,
    'enable_mcpm_receive'     => $enable_mcpm_receive,
    'balancer_name'           => $balancer_name,
    'server_advertise'        => $server_advertise,
    'advertise_frequency'     => $advertise_frequency,
    'manager_allowed_network' => $manager_allowed_network,
  }

  file { 'cluster.conf':
    ensure  => file,
    path    => "${apache::mod_dir}/cluster.conf",
    mode    => $apache::file_mode,
    content => epp('apache/mod/cluster.conf.epp', $parameters),
    require => Exec["mkdir ${apache::mod_dir}"],
    before  => File[$apache::mod_dir],
    notify  => Class['apache::service'],
  }
}