chore: set default nameservers (#240)
- if no nameservers are returned from puppetdb query, use default Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/240
This commit is contained in:
parent
829b1b05fd
commit
978013f325
@ -2,7 +2,7 @@
|
|||||||
class profiles::dns::base (
|
class profiles::dns::base (
|
||||||
String $ns_role = undef,
|
String $ns_role = undef,
|
||||||
Array $search = [],
|
Array $search = [],
|
||||||
Array $nameservers = ['8.8.8.8', '1.1.1.1'],
|
Array $nameservers = ['198.18.13.12', '198.18.13.13'],
|
||||||
Enum[
|
Enum[
|
||||||
'all',
|
'all',
|
||||||
'region',
|
'region',
|
||||||
@ -23,6 +23,12 @@ class profiles::dns::base (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if nameservers not returned from puppetdb, use default
|
||||||
|
$use_nameservers = empty($nameserver_array) ? {
|
||||||
|
true => $nameservers,
|
||||||
|
false => $nameserver_array,
|
||||||
|
}
|
||||||
|
|
||||||
# if search is undef, fallback to domainname from facts
|
# if search is undef, fallback to domainname from facts
|
||||||
if $search == [] {
|
if $search == [] {
|
||||||
$search_array = [$::facts['networking']['domain']]
|
$search_array = [$::facts['networking']['domain']]
|
||||||
@ -32,7 +38,7 @@ class profiles::dns::base (
|
|||||||
|
|
||||||
# include resolvconf class
|
# include resolvconf class
|
||||||
class { 'profiles::dns::resolvconf':
|
class { 'profiles::dns::resolvconf':
|
||||||
nameservers => sort($nameserver_array),
|
nameservers => sort($use_nameservers),
|
||||||
search_domains => sort($search_array),
|
search_domains => sort($search_array),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user