File: proxy_balancer.pp

package info (click to toggle)
puppet-module-puppetlabs-apache 12.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,664 kB
  • sloc: ruby: 275; sh: 32; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 1,231 bytes parent folder | download
1
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
# @summary
#   Installs and configures `mod_proxy_balancer`.
# 
# @param manager
#   Toggle whether to enable balancer manager support.
#
# @param manager_path
#   Server relative path to balancer manager.
#
# @param allow_from
#   List of IPs from which the balancer manager can be accessed.
#
# @see https://httpd.apache.org/docs/current/mod/mod_proxy_balancer.html for additional documentation.
#
class apache::mod::proxy_balancer (
  Boolean $manager                       = false,
  Stdlib::Unixpath $manager_path         = '/balancer-manager',
  Array[Stdlib::IP::Address] $allow_from = ['127.0.0.1', '::1'],
) {
  require apache::mod::proxy
  require apache::mod::proxy_http
  ::apache::mod { 'slotmem_shm': }
  ::apache::mod { 'proxy_balancer': }
  if $manager {
    include apache::mod::status
    file { 'proxy_balancer.conf':
      ensure  => file,
      path    => "${apache::mod_dir}/proxy_balancer.conf",
      mode    => $apache::file_mode,
      content => epp('apache/mod/proxy_balancer.conf.epp', { 'manager_path' => $manager_path, 'allow_from'  => $allow_from, }),
      require => Exec["mkdir ${apache::mod_dir}"],
      before  => File[$apache::mod_dir],
      notify  => Class['apache::service'],
    }
  }
}