neoloc/loopback_dns (#281)
- manage all interfaces in dns (except lo and anycast) - move loopback0 anycast addresses to be anycast0 Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/281
This commit was merged in pull request #281.
This commit is contained in:
@@ -1,30 +1,31 @@
|
||||
# profiles::dns::client
|
||||
define profiles::dns::client (
|
||||
Boolean $forward = true,
|
||||
Boolean $reverse = true,
|
||||
Integer $order = 10,
|
||||
Boolean $forward = true,
|
||||
Boolean $reverse = true,
|
||||
Integer $order = 10,
|
||||
String $interface = $facts['networking']['primary'],
|
||||
Stdlib::Fqdn $hostname = $facts['networking']['hostname'],
|
||||
Stdlib::Fqdn $domain = $facts['networking']['domain'],
|
||||
){
|
||||
|
||||
$intf = $facts['networking']['primary']
|
||||
$fqdn = $facts['networking']['fqdn']
|
||||
$last_octet = regsubst($::facts['networking']['ip'], '^.*\.', '')
|
||||
$last_octet = regsubst($facts['networking']['interfaces'][$interface]['ip'], '^.*\.', '')
|
||||
|
||||
if $forward {
|
||||
profiles::dns::record { "${fqdn}_${intf}_A":
|
||||
value => $::facts['networking']['ip'],
|
||||
profiles::dns::record { "${title}_A":
|
||||
value => $facts['networking']['interfaces'][$interface]['ip'],
|
||||
type => 'A',
|
||||
record => $::facts['networking']['hostname'],
|
||||
zone => $::facts['networking']['domain'],
|
||||
record => $hostname,
|
||||
zone => $domain,
|
||||
order => $order,
|
||||
}
|
||||
}
|
||||
|
||||
if $reverse {
|
||||
profiles::dns::record { "${fqdn}_${intf}_PTR":
|
||||
value => "${::facts['networking']['fqdn']}.",
|
||||
profiles::dns::record { "${title}_PTR":
|
||||
value => "${hostname}.${domain}.",
|
||||
type => 'PTR',
|
||||
record => $last_octet,
|
||||
zone => $::facts['arpa'][$intf]['zone'],
|
||||
zone => $facts['arpa'][$interface]['zone'],
|
||||
order => $order,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user