Merge pull request 'feat: add vrrp to halb' (#116) from neoloc/keepalived into develop

Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/116
This commit was merged in pull request #116.
This commit is contained in:
2024-07-14 22:07:34 +10:00
6 changed files with 69 additions and 1 deletions
+24
View File
@@ -1,5 +1,8 @@
# profiles::haproxy::dns
class profiles::haproxy::dns (
Stdlib::IP::Address $vrrp_ipaddr,
Boolean $vrrp_master = false,
Array[Stdlib::Fqdn] $vrrp_cnames = [],
Array[Stdlib::Fqdn] $cnames = [],
Integer $order = 10,
){
@@ -24,4 +27,25 @@ class profiles::haproxy::dns (
order => $order,
}
}
# export a/cnames for haproxy applications
if $vrrp_master {
profiles::dns::record { "${facts['networking']['fqdn']}_vrrp_${location_environment}-halb-vrrp":
value => $vrrp_ipaddr,
type => 'A',
record => "${location_environment}-halb-vrrp",
zone => $::facts['networking']['domain'],
order => $order,
}
$vrrp_cnames.each |$cname| {
profiles::dns::record { "${::facts['networking']['fqdn']}_${cname}_CNAME":
value => "${location_environment}-halb-vrrp",
type => 'CNAME',
record => "${cname}.",
zone => $::facts['networking']['domain'],
order => $order,
}
}
}
}