summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--attributes/designate_conf.rb1
-rw-r--r--recipes/common.rb11
-rw-r--r--spec/default_spec.rb2
3 files changed, 5 insertions, 9 deletions
diff --git a/attributes/designate_conf.rb b/attributes/designate_conf.rb
index 12e5c70..a7abf45 100644
--- a/attributes/designate_conf.rb
+++ b/attributes/designate_conf.rb
@@ -29,3 +29,4 @@ default['openstack']['dns']['conf']['keystone_authtoken']['username'] = 'designa
29default['openstack']['dns']['conf']['keystone_authtoken']['project_name'] = 'service' 29default['openstack']['dns']['conf']['keystone_authtoken']['project_name'] = 'service'
30default['openstack']['dns']['conf']['keystone_authtoken']['project_domain_name'] = 'Default' 30default['openstack']['dns']['conf']['keystone_authtoken']['project_domain_name'] = 'Default'
31default['openstack']['dns']['conf']['keystone_authtoken']['user_domain_name'] = 'Default' 31default['openstack']['dns']['conf']['keystone_authtoken']['user_domain_name'] = 'Default'
32default['openstack']['dns']['conf']['keystone_authtoken']['keystone_authtoken.service_token_roles_required'] = 'True'
diff --git a/recipes/common.rb b/recipes/common.rb
index 77876a8..956e373 100644
--- a/recipes/common.rb
+++ b/recipes/common.rb
@@ -46,10 +46,6 @@ if node['openstack']['mq']['service_type'] == 'rabbit'
46 node.default['openstack']['dns']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'dns' 46 node.default['openstack']['dns']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'dns'
47 # Note(jh): Workaround for https://bugs.launchpad.net/designate/+bug/1673403 47 # Note(jh): Workaround for https://bugs.launchpad.net/designate/+bug/1673403
48 # Stolen from rabbit_transport_url() in openstack-common/libraries/endpoints.rb 48 # Stolen from rabbit_transport_url() in openstack-common/libraries/endpoints.rb
49 mq_user = node['openstack']['mq']['dns']['rabbit']['userid']
50 node.default['openstack']['dns']['conf_secrets']['oslo_messaging_rabbit']['rabbit_userid'] = mq_user
51 node.default['openstack']['dns']['conf_secrets']['oslo_messaging_rabbit']['rabbit_password'] = get_password 'user', mq_user
52 node.default['openstack']['dns']['conf_secrets']['oslo_messaging_rabbit']['rabbit_virtual_host'] = node['openstack']['mq']['vhost']
53 mq_port = node['openstack']['endpoints']['mq']['port'] 49 mq_port = node['openstack']['endpoints']['mq']['port']
54 url = '' 50 url = ''
55 if node['openstack']['mq']['cluster'] 51 if node['openstack']['mq']['cluster']
@@ -61,11 +57,11 @@ if node['openstack']['mq']['service_type'] == 'rabbit'
61 bind_mq_address = bind_address node['openstack']['bind_service']['mq'] 57 bind_mq_address = bind_address node['openstack']['bind_service']['mq']
62 url += "#{bind_mq_address}:#{mq_port}" 58 url += "#{bind_mq_address}:#{mq_port}"
63 end 59 end
64 node.default['openstack']['dns']['conf_secrets']['oslo_messaging_rabbit']['rabbit_hosts'] = url
65end 60end
66 61
67db_user = node['openstack']['db']['dns']['username'] 62db_user = node['openstack']['db']['dns']['username']
68db_pass = get_password 'db', 'designate' 63db_pass = get_password 'db', 'designate'
64sql_connection = db_uri 'dns', db_user, db_pass
69 65
70bind_services = node['openstack']['bind_service']['all'] 66bind_services = node['openstack']['bind_service']['all']
71api_bind = bind_services['dns-api'] 67api_bind = bind_services['dns-api']
@@ -74,8 +70,9 @@ identity_endpoint = internal_endpoint 'identity'
74 70
75# define attributes that are needed in designate.conf 71# define attributes that are needed in designate.conf
76node.default['openstack']['dns']['conf'].tap do |conf| 72node.default['openstack']['dns']['conf'].tap do |conf|
77 conf['service:api']['api_host'] = bind_address api_bind 73 conf['database']['connection'] = sql_connection
78 conf['service:api']['api_port'] = api_bind['port'] 74 conf['listen']['api_host'] = bind_address api_bind
75 conf['listen']['api_port'] = api_bind['port']
79 conf['keystone_authtoken']['auth_url'] = identity_endpoint.to_s 76 conf['keystone_authtoken']['auth_url'] = identity_endpoint.to_s
80 conf['keystone_authtoken']['www_authenticate_uri'] = identity_endpoint.to_s 77 conf['keystone_authtoken']['www_authenticate_uri'] = identity_endpoint.to_s
81end 78end
diff --git a/spec/default_spec.rb b/spec/default_spec.rb
index 5fad027..d7d2a27 100644
--- a/spec/default_spec.rb
+++ b/spec/default_spec.rb
@@ -1,5 +1,3 @@
1require 'spec_helper'
2
3describe 'default recipe on Ubuntu 16.04' do 1describe 'default recipe on Ubuntu 16.04' do
4 let(:chef_run) do 2 let(:chef_run) do
5 ChefSpec::ServerRunner.new do |node| 3 ChefSpec::ServerRunner.new do |node|