view modules/apache/manifests/mod/proxy_balancer.pp @ 257:675c1cc61eaf

Update Apache module to get CentOS 8 support Unfortunately it only fixes some bits. mod_wsgi still needs other approaches This also overrides the vhost modification to make them come last in the import order (after module loading)
author IBBoard <dev@ibboard.co.uk>
date Sun, 22 Dec 2019 14:43:29 -0500
parents 956e484adc12
children d9352a684e62
line wrap: on
line source

class apache::mod::proxy_balancer(
  $manager        = false,
  $manager_path   = '/balancer-manager',
  $allow_from     = ['127.0.0.1','::1'],
  $apache_version = $::apache::apache_version,
) {
  validate_bool($manager)
  validate_string($manager_path)
  validate_array($allow_from)

  include ::apache::mod::proxy
  include ::apache::mod::proxy_http
  if versioncmp($apache_version, '2.4') >= 0 {
    ::apache::mod { 'slotmem_shm': }
  }

  Class['::apache::mod::proxy'] -> Class['::apache::mod::proxy_balancer']
  Class['::apache::mod::proxy_http'] -> Class['::apache::mod::proxy_balancer']
  ::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 => template('apache/mod/proxy_balancer.conf.erb'),
      require => Exec["mkdir ${::apache::mod_dir}"],
      before  => File[$::apache::mod_dir],
      notify  => Class['apache::service'],
    }
  }
}