Browse Source

update recipes for Chef 13

Samuel Cassiba 1 year ago
parent
commit
15d2af9791
2 changed files with 8 additions and 13 deletions
  1. 3
    3
      recipes/common.rb
  2. 5
    10
      recipes/identity_registration.rb

+ 3
- 3
recipes/common.rb View File

@@ -18,7 +18,7 @@
18 18
 # limitations under the License.
19 19
 #
20 20
 
21
-class ::Chef::Recipe # rubocop:disable Documentation
21
+class ::Chef::Recipe
22 22
   include ::Openstack
23 23
 end
24 24
 
@@ -67,7 +67,7 @@ end
67 67
 db_user = node['openstack']['db']['dns']['username']
68 68
 db_pass = get_password 'db', 'designate'
69 69
 
70
-public_identity_endpoint = identity_uri_transform(public_endpoint 'identity')
70
+public_identity_endpoint = identity_uri_transform(public_endpoint('identity'))
71 71
 identity_endpoint = internal_endpoint 'identity'
72 72
 
73 73
 bind_services = node['openstack']['bind_service']['all']
@@ -78,7 +78,7 @@ auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['dns']['
78 78
 # define attributes that are needed in designate.conf
79 79
 node.default['openstack']['dns']['conf'].tap do |conf|
80 80
   conf['service:api']['api_host'] = bind_address api_bind
81
-  conf['service:api']['api_port'] = api_bind.port
81
+  conf['service:api']['api_port'] = api_bind['port']
82 82
   conf['keystone_authtoken']['auth_uri'] = public_identity_endpoint
83 83
   conf['keystone_authtoken']['auth_url'] = auth_url
84 84
 end

+ 5
- 10
recipes/identity_registration.rb View File

@@ -20,7 +20,7 @@
20 20
 
21 21
 require 'uri'
22 22
 
23
-class ::Chef::Recipe # rubocop:disable Documentation
23
+class ::Chef::Recipe
24 24
   include ::Openstack
25 25
 end
26 26
 
@@ -49,7 +49,7 @@ connection_params = {
49 49
   openstack_username:     admin_user,
50 50
   openstack_api_key:      admin_pass,
51 51
   openstack_project_name: admin_project,
52
-  openstack_domain_name:  admin_domain
52
+  openstack_domain_name:  admin_domain,
53 53
 }
54 54
 
55 55
 # Register DNS Service
@@ -70,6 +70,7 @@ end
70 70
 # Register DNS Internal-Endpoint
71 71
 openstack_endpoint service_type do
72 72
   service_name service_name
73
+  interface 'internal'
73 74
   url internal_designate_endpoint.to_s
74 75
   region region
75 76
   connection_params connection_params
@@ -82,16 +83,10 @@ end
82 83
 
83 84
 # Register Service User
84 85
 openstack_user service_user do
86
+  role_name service_role
85 87
   project_name service_project_name
86 88
   domain_name service_domain_name
87 89
   password service_pass
88 90
   connection_params connection_params
89
-end
90
-
91
-## Grant Service role to Service User for Service Project ##
92
-openstack_user service_user do
93
-  role_name service_role
94
-  project_name service_project_name
95
-  connection_params connection_params
96
-  action :grant_role
91
+  action [:create, :grant_role]
97 92
 end

Loading…
Cancel
Save