Browse Source

Merge "Remove bind and bind pool generation for designate from puppet"

changes/46/790246/2
Zuul 4 days ago
committed by Gerrit Code Review
parent
commit
69ec322e8f
7 changed files with 21 additions and 114 deletions
  1. +9
    -16
      manifests/profile/base/designate.pp
  2. +4
    -2
      manifests/profile/base/designate/backend.pp
  3. +4
    -13
      manifests/profile/base/designate/central.pp
  4. +4
    -4
      manifests/profile/base/designate/worker.pp
  5. +0
    -34
      spec/classes/tripleo_profile_base_designate_central_spec.rb
  6. +0
    -2
      spec/classes/tripleo_profile_base_designate_spec.rb
  7. +0
    -43
      templates/designate/pools.yaml.erb

+ 9
- 16
manifests/profile/base/designate.pp View File

@ -70,17 +70,19 @@
# Enable ssl oslo messaging services
# Defaults to hiera('oslo_messaging_notify_use_ssl', '0')
#
# [* DEPRECATED PARAMETERS *]
#
# [*rndc_host*]
# The address on which rndc should listen
# Defaults to undef
#
# [*rndc_port*]
# The port on which rndc should listen
# Defaults to 953
# Defaults undef
#
# [*rndc_keys*]
# A list of keys that rndc should accept
# Defaults to ['rndc-key']
# Defaults to undef
#
# [*rndc_allowed_addresses*]
# A list of addresses that are allowed to send rndc commands
@ -100,9 +102,10 @@ class tripleo::profile::base::designate (
$oslomsg_notify_port = hiera('oslo_messaging_notify_port', '5672'),
$oslomsg_notify_username = hiera('oslo_messaging_notify_user_name', 'guest'),
$oslomsg_notify_use_ssl = hiera('oslo_messaging_notify_use_ssl', '0'),
# DEPRECATED PARAMETERS
$rndc_host = undef,
$rndc_port = 953,
$rndc_keys = ['rndc-key'],
$rndc_port = undef,
$rndc_keys = undef,
$rndc_allowed_addresses = undef,
) {
if $step >= 3 {
@ -126,18 +129,8 @@ class tripleo::profile::base::designate (
'ssl' => $oslomsg_notify_use_ssl_real,
}),
}
if ($rndc_host and $rndc_allowed_addresses) {
class { 'designate::backend::bind9':
rndc_controls => {
$rndc_host => {
'port' => $rndc_port,
'keys' => $rndc_keys,
'allowed_addresses' => $rndc_allowed_addresses,
}
},
}
} else {
include designate::backend::bind9
if ($rndc_host or $rndc_allowed_addresses or $rndc_keys or $rndc_allowed_addresses) {
warning('rndc/named configuration through puppet is no longer supported.')
}
include designate::config
include designate::logging


+ 4
- 2
manifests/profile/base/designate/backend.pp View File

@ -33,9 +33,11 @@ class tripleo::profile::base::designate::backend (
) {
if $step >= 4 {
if $backend == 'bind9' {
include designate::backend::bind9
class{ 'designate::backend::bind9':
configure_bind => false
}
} else {
fail("${backend} is not supported by designate")
fail('${backend} is not supported by designate')
}
}
}

+ 4
- 13
manifests/profile/base/designate/central.pp View File

@ -27,6 +27,8 @@
# for more details.
# Defaults to hiera('step')
#
# DEPRECATED PARAMETERS
#
# [*pools_file_content*]
# (Optional) The content of /etc/designate/pools.yaml
# Defaults to the content of templates/designate/pools.yaml.erb
@ -34,6 +36,7 @@
class tripleo::profile::base::designate::central (
$bootstrap_node = hiera('designate_central_short_bootstrap_node_name', undef),
$step = Integer(hiera('step')),
# DEPRECATED PARAMETERS
$pools_file_content = undef,
) {
if $bootstrap_node and $::hostname == downcase($bootstrap_node) {
@ -43,13 +46,7 @@ class tripleo::profile::base::designate::central (
}
if $pools_file_content {
$pools_file_content_real = $pools_file_content
} else {
$pools_file_content_real = template('tripleo/designate/pools.yaml.erb')
}
file { 'designate pools':
path => '/etc/designate/pools.yaml',
content => $pools_file_content_real,
warning('pool file content is no longer manually configurable')
}
include tripleo::profile::base::designate
if ($step >= 4 or ($step >= 3 and $sync_db)) {
@ -59,10 +56,4 @@ class tripleo::profile::base::designate::central (
include designate::central
include designate::quota
}
if ($step == 5 and $sync_db) {
exec { 'pool update':
command => '/bin/designate-manage pool update',
user => 'designate',
}
}
}

+ 4
- 4
manifests/profile/base/designate/worker.pp View File

@ -23,22 +23,22 @@
# for more details.
# Defaults to hiera('step')
#
# DEPRECATED PARAMETERS
#
# [*rndc_key*]
# (Optional) The base64-encoded key secret for /etc/rndc.key.
# Defaults to hiera('designate_rndc_key')
#
class tripleo::profile::base::designate::worker (
$step = Integer(hiera('step')),
# DEPRECATED PARAMETERS
$rndc_key = hiera('designate_rndc_key', false),
) {
include tripleo::profile::base::designate
if $step >= 4 {
if $rndc_key {
file { 'designate rndc key':
path => '/etc/rndc.key',
content => template('tripleo/designate/rndc.key.erb')
}
warning('Configuring rndc keys through puppet has been deprecated')
}
include designate::worker
}


+ 0
- 34
spec/classes/tripleo_profile_base_designate_central_spec.rb View File

@ -43,10 +43,6 @@ eos
is_expected.to_not contain_class('designate::db')
is_expected.to_not contain_class('designate::central')
is_expected.to_not contain_class('designate::quota')
is_expected.to contain_file('designate pools').with(
:path => '/etc/designate/pools.yaml',
)
is_expected.to_not contain_exec('pool update')
}
end
@ -62,8 +58,6 @@ eos
is_expected.to contain_class('designate::db').with(:sync_db => true)
is_expected.to contain_class('designate::central')
is_expected.to contain_class('designate::quota')
is_expected.to contain_file('designate pools')
is_expected.to_not contain_exec('pool update')
}
end
@ -79,8 +73,6 @@ eos
is_expected.to_not contain_class('designate::db')
is_expected.to_not contain_class('designate::central')
is_expected.to_not contain_class('designate::quota')
is_expected.to contain_file('designate pools')
is_expected.to_not contain_exec('pool update')
}
end
@ -98,35 +90,9 @@ eos
)
is_expected.to contain_class('designate::central')
is_expected.to contain_class('designate::quota')
is_expected.to contain_file('designate pools')
is_expected.to_not contain_exec('pool update')
}
end
context 'with step 5 on bootstrap node' do
let(:params) { {
:step => 5,
:bootstrap_node => 'node.example.com',
} }
it {
is_expected.to contain_exec('pool update').with(
:command => '/bin/designate-manage pool update',
:user => 'designate'
)
}
end
context 'with step 5 not on bootstrap node' do
let(:params) { {
:step => 5,
:bootstrap_node => 'other.example.com',
} }
it {
is_expected.to_not contain_exec('pool update')
}
end
end


+ 0
- 2
spec/classes/tripleo_profile_base_designate_spec.rb View File

@ -31,7 +31,6 @@ describe 'tripleo::profile::base::designate' do
is_expected.to_not contain_class('designate')
is_expected.to_not contain_class('designate::config')
is_expected.to_not contain_class('designate::logging')
is_expected.to_not contain_class('designate::backend::bind9')
}
end
@ -50,7 +49,6 @@ describe 'tripleo::profile::base::designate' do
)
is_expected.to contain_class('designate::config')
is_expected.to contain_class('designate::logging')
is_expected.to contain_class('designate::backend::bind9')
}
end


+ 0
- 43
templates/designate/pools.yaml.erb View File

@ -1,43 +0,0 @@
- name: default
# The name is immutable. There will be no option to change the name after
# creation and the only way will to change it will be to delete it
# (and all zones associated with it) and recreate it.
description: Default Pool
attributes: {}
# List out the NS records for zones hosted within this pool
# This should be a record that is created outside of designate, that
# points to the public IP of the controller node.
ns_records:
- hostname: ns1-1.example.org.
priority: 1
# 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: 127.0.0.1
port: 53
# 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:
- type: bind9
description: BIND9 Server 1
# 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:
- host: 127.0.0.1
port: 5354
# BIND Configuration options
options:
host: 127.0.0.1
port: 53
rndc_host: 127.0.0.1
rndc_port: 953
rndc_key_file: /etc/rndc.key

Loading…
Cancel
Save