Add support for deploying multiple DNS servers

This commit is contained in:
Jens Harbott 2017-11-28 09:51:34 +00:00
parent 4a4c2a87e6
commit f5ba64c51d
4 changed files with 20 additions and 19 deletions

View File

@ -41,10 +41,10 @@ default['openstack']['dns']['syslog']['use'] = false
default['openstack']['dns']['api']['auth']['version'] = node['openstack']['api']['auth']['version'] default['openstack']['dns']['api']['auth']['version'] = node['openstack']['api']['auth']['version']
# Settings for the default pool # Settings for the default pool
default['openstack']['dns']['pool']['ns_hostname'] = 'ns1.example.org.' default['openstack']['dns']['pool']['ns_hostnames'] = ['ns1.example.org.']
default['openstack']['dns']['pool']['ns_address'] = '127.0.0.1' default['openstack']['dns']['pool']['ns_addresses'] = ['127.0.0.1']
default['openstack']['dns']['pool']['masters'] = ['127.0.0.1'] default['openstack']['dns']['pool']['masters'] = ['127.0.0.1']
default['openstack']['dns']['pool']['bind_host'] = '127.0.0.1' default['openstack']['dns']['pool']['bind_hosts'] = ['127.0.0.1']
# platform-specific settings # platform-specific settings
default['openstack']['dns']['user'] = 'designate' default['openstack']['dns']['user'] = 'designate'

View File

@ -7,7 +7,7 @@ source_url 'https://github.com/cloudbau/cookbook-openstack-dns' if respond_to?(:
license 'Apache 2.0' license 'Apache 2.0'
description 'Installs and configures the Designate Service' description 'Installs and configures the Designate Service'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0' version '0.2.0'
%w(ubuntu redhat centos).each do |os| %w(ubuntu redhat centos).each do |os|
supports os supports os

View File

@ -139,10 +139,10 @@ template '/etc/designate/pools.yaml' do
mode 00644 mode 00644
variables( variables(
banner: node['openstack']['dns']['custom_template_banner'], banner: node['openstack']['dns']['custom_template_banner'],
bind_host: pool_config['bind_host'], bind_hosts: pool_config['bind_hosts'],
masters: pool_config['masters'], masters: pool_config['masters'],
ns_address: pool_config['ns_address'], ns_addresses: pool_config['ns_addresses'],
ns_hostname: pool_config['ns_hostname'] ns_hostnames: pool_config['ns_hostnames']
) )
end end

View File

@ -11,36 +11,37 @@
# This should be a record that is created outside of designate, that # This should be a record that is created outside of designate, that
# points to the public IP of the controller node. # points to the public IP of the controller node.
ns_records: ns_records:
- hostname: <%= @ns_hostname %> <% @ns_hostnames.each do |ns_hostname| %>
- hostname: <%= ns_hostname %>
priority: 1 priority: 1
<% end %>
# List out the nameservers for this pool. These are the actual BIND servers. # List out the nameservers for this pool. These are the actual BIND servers.
# We use these to verify changes have propagated to all nameservers. # We use these to verify changes have propagated to all nameservers.
nameservers: nameservers:
- host: <%= @ns_address %> <% @ns_addresses.each do |ns_address| %>
- host: <%= ns_address %>
port: 53 port: 53
<% end %>
# List out the targets for this pool. For BIND there will be one # List out the targets for this pool. For BIND there will be one
# entry for each BIND server, as we have to run rndc command on each server # entry for each BIND server, as we have to run rndc command on each server
targets: targets:
<% @bind_hosts.each do |bind_host| %>
- type: bind9 - type: bind9
description: BIND9 Server 1 description: BIND9 Server <%= bind_host %>
# List out the designate-mdns servers from which BIND servers should
# request zone transfers (AXFRs) from.
# This should be the IP of the controller node.
# If you have multiple controllers you can add multiple masters
# by running designate-mdns on them, and adding them here.
masters: masters:
<% @masters.each do |host| %> <% @masters.each do |host| %>
- host: <%= host %> - host: <%= host %>
port: 5354 port: 5354
<% end %> <% end %>
# BIND Configuration options # BIND Configuration options
options: options:
host: <%= @bind_host %> host: <%= bind_host %>
port: 53 port: 53
rndc_host: <%= @bind_host %> rndc_host: <%= bind_host %>
rndc_port: 953 rndc_port: 953
rndc_key_file: /etc/designate/rndc.key rndc_key_file: /etc/designate/rndc.key
<% end %>