Debian/Ubuntu: Fix rndc.key file path in rndc.conf

In Debian families, the rndc.key file is created in /etc/bind instead
of /etc. This fixes the key file path in rndc.conf.

Also this updates the rncd.conf path to place it in the same directory.

Change-Id: If6fa440541b5c8b3073b72de97d9550dbe6f8c2a
This commit is contained in:
Takashi Kajinami 2023-12-07 16:20:06 +09:00
parent 9121aaeed7
commit 547cebc73f
4 changed files with 12 additions and 3 deletions

View File

@ -159,6 +159,9 @@ fi
# bind
if [ -d /etc/named ]; then
sudo cp -r /etc/named $LOG_DIR/etc
if [ -f /etc/rndc.conf ]; then
sudo cp -r /etc/rndc.conf $LOG_DIR/rndc.conf
fi
elif [ -d /etc/bind ]; then
sudo cp -r /etc/bind $LOG_DIR/etc
fi

View File

@ -42,10 +42,13 @@ class openstack_integration::bind {
},
}
$dnsdir = $::dns::params::dnsdir
# ::dns creates the rndc key but not a rndc.conf.
# Contribute this in upstream ::dns ?
file { '/etc/rndc.conf':
file { 'rndc.conf':
ensure => present,
path => "${dnsdir}/rndc.conf",
owner => $::dns::params::user,
group => $::dns::params::group,
content => template("${module_name}/rndc.conf.erb"),

View File

@ -124,10 +124,13 @@ class openstack_integration::designate (
bind9_hosts => [$::openstack_integration::config::host],
dns_port => 5322,
mdns_hosts => [$::openstack_integration::config::host],
rndc_config_file => '/etc/rndc.conf',
rndc_config_file => "${::dns::params::dnsdir}/rndc.conf",
rndc_key_file => $::dns::params::rndckeypath,
manage_pool => true,
# Configure bind using openstack_integration::bind
configure_bind => false,
}
File['rndc.conf'] -> Anchor['designate::service::begin']
Class['dns::service'] -> Anchor['designate::service::begin']
}

View File

@ -1,4 +1,4 @@
include "/etc/rndc.key";
include "<%= @dnsdir %>/rndc.key";
options {
default-key "rndc-key";
default-server <%= @bind_host %>;