Defined Type: profile::openstack::base::haproxy::site

Defined in:
modules/profile/manifests/openstack/base/haproxy/site.pp

Overview

healthcheck_options

Array of Strings A list of healthcheck (http-check) options

Examples

profile::openstack::base::haproxy::site { 'nova_metadata':
    port_frontend => '8775',
    port_backend  => '18775',
    servers       => ['backend-host01', 'backend-host02'],
}

Parameters:

  • servers (Array[Stdlib::Fqdn])
  • port_backend (Stdlib::Port)
  • port_frontend (Stdlib::Port)
  • healthcheck_path (Stdlib::Compat::String)
  • healthcheck_method (String)
  • healthcheck_options (Array[String]) (defaults to: [])
  • ensure (Wmflib::Ensure) (defaults to: present)


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
# File 'modules/profile/manifests/openstack/base/haproxy/site.pp', line 42

define profile::openstack::base::haproxy::site(
    Array[Stdlib::Fqdn] $servers,
    Stdlib::Port $port_backend,
    Stdlib::Port $port_frontend,
    Stdlib::Compat::String $healthcheck_path,
    String $healthcheck_method,
    Array[String] $healthcheck_options = [],
    Wmflib::Ensure $ensure = present,
) {
    include profile::openstack::base::haproxy

    # If the host's FQDN is in $servers configure FERM to allow peer
    # connections on the backend service port.
    if $::fqdn in $servers {
        # Allow traffic to peers on backend ports
        $peers = join(delete($servers, $::fqdn), ' ')
        ferm::service { "${title}_haproxy_backend":
            proto  => 'tcp',
            port   => $port_backend,
            srange => "(@resolve((${peers})) @resolve((${peers}), AAAA))",
        }
    }

    file { "/etc/haproxy/conf.d/${title}.cfg":
        ensure  => $ensure,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('profile/openstack/base/haproxy/conf.d/http-service.cfg.erb'),
        # restart to pick up new config files in conf.d
        notify  => Exec['restart-haproxy'],
    }
}