Merge pull request #9 from cloudbau/pike-chef13

Pike chef13
This commit is contained in:
Jan Klare 2018-02-12 12:58:51 +01:00 committed by GitHub
commit 6239cd780d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 22 deletions

View File

@ -41,17 +41,17 @@ default['openstack']['dns']['syslog']['use'] = false
default['openstack']['dns']['api']['auth']['version'] = node['openstack']['api']['auth']['version']
# Settings for the default pool
default['openstack']['dns']['pool']['ns_hostname'] = 'ns1.example.org.'
default['openstack']['dns']['pool']['ns_address'] = '127.0.0.1'
default['openstack']['dns']['pool']['ns_hostnames'] = ['ns1.example.org.']
default['openstack']['dns']['pool']['ns_addresses'] = ['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
default['openstack']['dns']['user'] = 'designate'
default['openstack']['dns']['group'] = 'designate'
case node['platform_family']
# Note(jh): TBC
when 'rhel'
# Note(jh): TBC
default['openstack']['dns']['platform'] = {
'designate_packages' => ['openstack-designate'],
'designate_api_service' => 'openstack-designate-api',
@ -60,7 +60,8 @@ when 'rhel'
}
when 'debian'
default['openstack']['dns']['platform'] = {
'designate_packages' => ['designate-api','designate-central','designate-mdns','designate-producer','designate-worker'],
'designate_packages' => ['designate-api', 'designate-central', 'designate-mdns', 'designate-producer', 'designate-worker', 'bind9utils'],
'designate_dashboard_packages' => ['python-designate-dashboard'],
'designate_api_service' => 'designate-api',
'designate_central_service' => 'designate-central',
'designate_mdns_service' => 'designate-mdns',

View File

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

View File

@ -78,7 +78,7 @@ auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['dns']['
# define attributes that are needed in designate.conf
node.default['openstack']['dns']['conf'].tap do |conf|
conf['service:api']['api_host'] = bind_address api_bind
conf['service:api']['api_port'] = api_bind.port
conf['service:api']['api_port'] = api_bind['port']
conf['keystone_authtoken']['auth_uri'] = public_identity_endpoint
conf['keystone_authtoken']['auth_url'] = auth_url
end
@ -139,10 +139,10 @@ template '/etc/designate/pools.yaml' do
mode 00644
variables(
banner: node['openstack']['dns']['custom_template_banner'],
bind_host: pool_config['bind_host'],
bind_hosts: pool_config['bind_hosts'],
masters: pool_config['masters'],
ns_address: pool_config['ns_address'],
ns_hostname: pool_config['ns_hostname']
ns_addresses: pool_config['ns_addresses'],
ns_hostnames: pool_config['ns_hostnames']
)
end

32
recipes/dashboard.rb Normal file
View File

@ -0,0 +1,32 @@
# encoding: UTF-8
#
# Cookbook Name:: openstack-dns
# Recipe:: dashboard
#
# Copyright 2017, x-ion Gmbh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
class ::Chef::Recipe # rubocop:disable Documentation
include ::Openstack
end
platform_options = node['openstack']['dns']['platform']
platform_options['designate_dashboard_packages'].each do |pkg|
package pkg do
options platform_options['package_overrides']
action :upgrade
end
end

View File

@ -70,6 +70,7 @@ end
# Register DNS Internal-Endpoint
openstack_endpoint service_type do
service_name service_name
interface 'internal'
url internal_designate_endpoint.to_s
region region
connection_params connection_params

View File

@ -11,36 +11,37 @@
# This should be a record that is created outside of designate, that
# points to the public IP of the controller node.
ns_records:
- hostname: <%= @ns_hostname %>
<% @ns_hostnames.each do |ns_hostname| %>
- hostname: <%= ns_hostname %>
priority: 1
<% end %>
# List out the nameservers for this pool. These are the actual BIND servers.
# We use these to verify changes have propagated to all nameservers.
nameservers:
- host: <%= @ns_address %>
<% @ns_addresses.each do |ns_address| %>
- host: <%= ns_address %>
port: 53
<% end %>
# 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
targets:
<% @bind_hosts.each do |bind_host| %>
- 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.each do |host| %>
<% @masters.each do |host| %>
- host: <%= host %>
port: 5354
<% end %>
<% end %>
# BIND Configuration options
options:
host: <%= @bind_host %>
host: <%= bind_host %>
port: 53
rndc_host: <%= @bind_host %>
rndc_host: <%= bind_host %>
rndc_port: 953
rndc_key_file: /etc/designate/rndc.key
<% end %>