promote develop to master #6
@ -57,6 +57,7 @@ profiles::base::puppet_servers:
|
|||||||
|
|
||||||
profiles::dns::master::basedir: '/var/named/sources'
|
profiles::dns::master::basedir: '/var/named/sources'
|
||||||
profiles::dns::base::ns_role: 'roles::infra::dns::resolver'
|
profiles::dns::base::ns_role: 'roles::infra::dns::resolver'
|
||||||
|
profiles::dns::base::use_ns: 'region'
|
||||||
|
|
||||||
profiles::packages::install:
|
profiles::packages::install:
|
||||||
- bash-completion
|
- bash-completion
|
||||||
|
|||||||
@ -3,16 +3,24 @@ 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 = ['8.8.8.8', '1.1.1.1'],
|
||||||
|
Enum[
|
||||||
|
'all',
|
||||||
|
'region',
|
||||||
|
'country'
|
||||||
|
] $use_ns = 'all',
|
||||||
){
|
){
|
||||||
|
|
||||||
# install bind_utils
|
# install bind_utils
|
||||||
include bind::updater
|
include bind::updater
|
||||||
|
|
||||||
# if ns_role is set, find all hosts matching that enc_role
|
# if ns_role is set, find all hosts matching that enc_role
|
||||||
if $ns_role == undef {
|
$nameserver_array = $ns_role ? {
|
||||||
$nameserver_array = $nameservers
|
undef => $nameservers,
|
||||||
}else{
|
default => $use_ns ? {
|
||||||
$nameserver_array = query_nodes("enc_role='${ns_role}'", 'networking.ip')
|
'all' => query_nodes("enc_role='${ns_role}'", 'networking.ip'),
|
||||||
|
'region' => query_nodes("enc_role='${ns_role}' and region=${facts['region']}", 'networking.ip'),
|
||||||
|
'country' => query_nodes("enc_role='${ns_role}' and country=${facts['country']}", 'networking.ip'),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# if search is undef, fallback to domainname from facts
|
# if search is undef, fallback to domainname from facts
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user