diff --git a/recipes/common.rb b/recipes/common.rb index bfca7c2..1170d42 100644 --- a/recipes/common.rb +++ b/recipes/common.rb @@ -18,7 +18,7 @@ # limitations under the License. # -class ::Chef::Recipe # rubocop:disable Documentation +class ::Chef::Recipe include ::Openstack end @@ -67,7 +67,7 @@ end db_user = node['openstack']['db']['dns']['username'] db_pass = get_password 'db', 'designate' -public_identity_endpoint = identity_uri_transform(public_endpoint 'identity') +public_identity_endpoint = identity_uri_transform(public_endpoint('identity')) identity_endpoint = internal_endpoint 'identity' bind_services = node['openstack']['bind_service']['all'] @@ -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 diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb index a803fee..71c45ea 100644 --- a/recipes/identity_registration.rb +++ b/recipes/identity_registration.rb @@ -20,7 +20,7 @@ require 'uri' -class ::Chef::Recipe # rubocop:disable Documentation +class ::Chef::Recipe include ::Openstack end @@ -49,7 +49,7 @@ connection_params = { openstack_username: admin_user, openstack_api_key: admin_pass, openstack_project_name: admin_project, - openstack_domain_name: admin_domain + openstack_domain_name: admin_domain, } # Register DNS Service @@ -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 @@ -82,16 +83,10 @@ end # Register Service User openstack_user service_user do + role_name service_role project_name service_project_name domain_name service_domain_name password service_pass connection_params connection_params -end - -## Grant Service role to Service User for Service Project ## -openstack_user service_user do - role_name service_role - project_name service_project_name - connection_params connection_params - action :grant_role + action [:create, :grant_role] end