dns: Disable IPv6 in named when host has no IPv6 address
This commit is contained in:
parent
a0c854d3c0
commit
ee7fc4dc38
1 changed files with 34 additions and 1 deletions
|
@ -78,6 +78,39 @@ class dns::server {
|
|||
}
|
||||
}
|
||||
|
||||
if ! $::ipaddress6 {
|
||||
$options = $::operatingsystem ? {
|
||||
"debian" => "-u bind -4",
|
||||
"ubuntu" => "-u bind -4",
|
||||
default => "-4",
|
||||
}
|
||||
} else {
|
||||
$options = $::operatingsystem ? {
|
||||
"debian" => "-u bind",
|
||||
"ubuntu" => "-u bind",
|
||||
default => "",
|
||||
}
|
||||
}
|
||||
|
||||
case $::operatingsystem {
|
||||
"debian", "ubuntu": {
|
||||
augeas { "set-named-default":
|
||||
context => "/files/etc/default/named",
|
||||
changes => [ "set OPTIONS '${options}'",
|
||||
notify => Service["named"],
|
||||
require => Package["bind"],
|
||||
}
|
||||
}
|
||||
"fedora","centos","redhat": {
|
||||
augeas { "set-named-sysconfig":
|
||||
context => "/files/etc/sysconfi/named",
|
||||
changes => [ "set OPTIONS '${options}'",
|
||||
notify => Service["named"],
|
||||
require => Package["bind"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file { "${chroot}${rndckey}":
|
||||
ensure => present,
|
||||
mode => "0640",
|
||||
|
@ -130,7 +163,7 @@ class dns::server {
|
|||
default => undef,
|
||||
},
|
||||
start => $::operatingsystem ? {
|
||||
"openbsd" => "/usr/sbin/named",
|
||||
"openbsd" => "/usr/sbin/named ${options}",
|
||||
default => undef,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue