diff --git a/copy_logs.sh b/copy_logs.sh index 9d5388a59..b7402c690 100755 --- a/copy_logs.sh +++ b/copy_logs.sh @@ -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 diff --git a/manifests/bind.pp b/manifests/bind.pp index da3f75ad1..2b3c59b6a 100644 --- a/manifests/bind.pp +++ b/manifests/bind.pp @@ -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"), diff --git a/manifests/designate.pp b/manifests/designate.pp index cb7444ad3..44d1d62e4 100644 --- a/manifests/designate.pp +++ b/manifests/designate.pp @@ -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'] } diff --git a/templates/rndc.conf.erb b/templates/rndc.conf.erb index 62a784623..92c52c4a9 100644 --- a/templates/rndc.conf.erb +++ b/templates/rndc.conf.erb @@ -1,4 +1,4 @@ -include "/etc/rndc.key"; +include "<%= @dnsdir %>/rndc.key"; options { default-key "rndc-key"; default-server <%= @bind_host %>;