- use puppetdbquery module to query puppetdb for resolvers - move dns client config to profiles::dns::base - manage the /etc/resolv.conf file
32 lines
829 B
Puppet
32 lines
829 B
Puppet
# profiles::dns::client
|
|
define profiles::dns::client (
|
|
Boolean $forward = true,
|
|
Boolean $reverse = true,
|
|
Integer $order = 10,
|
|
){
|
|
|
|
$intf = $facts['networking']['primary']
|
|
$fqdn = $facts['networking']['fqdn']
|
|
$last_octet = regsubst($::facts['networking']['ip'], '^.*\.', '')
|
|
|
|
if $forward {
|
|
profiles::dns::record { "${fqdn}_${intf}_A":
|
|
value => $::facts['networking']['ip'],
|
|
type => 'A',
|
|
record => $::facts['networking']['hostname'],
|
|
zone => $::facts['networking']['domain'],
|
|
order => $order,
|
|
}
|
|
}
|
|
|
|
if $reverse {
|
|
profiles::dns::record { "${fqdn}_${intf}_PTR":
|
|
value => "${::facts['networking']['fqdn']}.",
|
|
type => 'PTR',
|
|
record => $last_octet,
|
|
zone => $::facts['arpa'][$intf]['zone'],
|
|
order => $order,
|
|
}
|
|
}
|
|
}
|