Fix designate config

The changes in [0] sadly were almost, but not quite, completely broken.
They introduced config options that do not exist in designate and also
made secrets being saved into the node config.

Fix all this, also clean up the remainder of a workaround that is no
longer needed.

This was partially fixed for stable/queens in [1].

backport: stable/queens

[0] If4e185eb58a525e22971c7a8b876274c353db847
[1] https://review.opendev.org/606094

Change-Id: I5ccb4fa5d8f3a003c4dd1b07e1c9ab2a99246dd6
This commit is contained in:
Jens Harbott 2019-08-13 12:06:26 +00:00
parent a6ec207561
commit be2fd380fa
2 changed files with 3 additions and 18 deletions

View File

@ -29,4 +29,4 @@ default['openstack']['dns']['conf']['keystone_authtoken']['username'] = 'designa
default['openstack']['dns']['conf']['keystone_authtoken']['project_name'] = 'service'
default['openstack']['dns']['conf']['keystone_authtoken']['project_domain_name'] = 'Default'
default['openstack']['dns']['conf']['keystone_authtoken']['user_domain_name'] = 'Default'
default['openstack']['dns']['conf']['keystone_authtoken']['keystone_authtoken.service_token_roles_required'] = 'True'
default['openstack']['dns']['conf']['keystone_authtoken']['service_token_roles_required'] = 'True'

View File

@ -44,35 +44,20 @@ end
if node['openstack']['mq']['service_type'] == 'rabbit'
node.default['openstack']['dns']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'dns'
# Note(jh): Workaround for https://bugs.launchpad.net/designate/+bug/1673403
# Stolen from rabbit_transport_url() in openstack-common/libraries/endpoints.rb
mq_port = node['openstack']['endpoints']['mq']['port']
url = ''
if node['openstack']['mq']['cluster']
node['openstack']['mq']['servers'].each do |server|
url += "#{server}:#{mq_port}"
url += ',' unless node['openstack']['mq']['servers'].last == server
end
else
bind_mq_address = bind_address node['openstack']['bind_service']['mq']
url += "#{bind_mq_address}:#{mq_port}"
end
end
db_user = node['openstack']['db']['dns']['username']
db_pass = get_password 'db', 'designate'
sql_connection = db_uri 'dns', db_user, db_pass
bind_services = node['openstack']['bind_service']['all']
api_bind = bind_services['dns-api']
api_bind_str = "#{bind_address api_bind}:#{api_bind['port']}"
identity_endpoint = internal_endpoint 'identity'
# define attributes that are needed in designate.conf
node.default['openstack']['dns']['conf'].tap do |conf|
conf['database']['connection'] = sql_connection
conf['listen']['api_host'] = bind_address api_bind
conf['listen']['api_port'] = api_bind['port']
conf['service:api']['listen'] = api_bind_str
conf['keystone_authtoken']['auth_url'] = identity_endpoint.to_s
conf['keystone_authtoken']['www_authenticate_uri'] = identity_endpoint.to_s
end