feat: add haproxy2 role (#322)

- add basic haproxy2 role
- add peers and resolvers
- add haproxy2+ metrics frontend

Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/322
This commit was merged in pull request #322.
This commit is contained in:
2025-06-28 16:20:06 +10:00
parent bd9e08dc24
commit 770fd643ac
9 changed files with 529 additions and 21 deletions
+10 -3
View File
@@ -36,16 +36,21 @@ class profiles::haproxy::server (
$merged_default_options = merge($default_options, $defaults)
# wait until enc_role matches haproxy enc_role
if $facts['enc_role'] == 'roles::infra::halb::haproxy' {
if $facts['enc_role'] in [
'roles::infra::halb::haproxy',
'roles::infra::halb::haproxy2'
] {
# manage selinux
include profiles::haproxy::selinux
if $facts['virtual'] != 'lxc' {
include profiles::haproxy::selinux
}
# create the haproxy service/instance
class { 'haproxy':
global_options => $merged_global_options,
defaults_options => $merged_default_options,
require => Class['profiles::haproxy::selinux']
#require => Class['profiles::haproxy::selinux']
}
include certbot::client # download certbot certs
@@ -53,9 +58,11 @@ class profiles::haproxy::server (
include profiles::haproxy::mappings # manage the domain to backend mappings
include profiles::haproxy::ls_stats # default status listener
include profiles::haproxy::dns # manage dns for haproxy
include profiles::haproxy::resolvers # manage resolvers
include profiles::haproxy::frontends # create frontends
include profiles::haproxy::backends # create backends
include profiles::haproxy::listeners # create listeners
include profiles::haproxy::peers # create peers
include prometheus::haproxy_exporter # generate metrics
Class['profiles::haproxy::certlist']