- update keepalived module to 5.1.0 - add keepalived::vrrp::* to be deep merged in hiera - add vrrp dns configuration - add vrrp instance/script to halb in syd1
52 lines
1.6 KiB
Puppet
52 lines
1.6 KiB
Puppet
# 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,
|
|
){
|
|
|
|
# create an A record for each load balancer in a region
|
|
$location_environment = "${facts['country']}-${facts['region']}-${facts['environment']}"
|
|
profiles::dns::record { "${facts['networking']['fqdn']}_${location_environment}-halb_A":
|
|
value => $::facts['networking']['ip'],
|
|
type => 'A',
|
|
record => "${location_environment}-halb",
|
|
zone => $::facts['networking']['domain'],
|
|
order => $order,
|
|
}
|
|
|
|
# export cnames for haproxy applications
|
|
$cnames.each |$cname| {
|
|
profiles::dns::record { "${::facts['networking']['fqdn']}_${cname}_CNAME":
|
|
value => "${location_environment}-halb",
|
|
type => 'CNAME',
|
|
record => "${cname}.",
|
|
zone => $::facts['networking']['domain'],
|
|
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,
|
|
}
|
|
}
|
|
}
|
|
}
|