Browse Source

Deprecate auth_uri option

Option auth_uri from group keystone_authtoken is deprecated[1].
Use option www_authenticate_uri from group keystone_authtoken.

[1]https://review.openstack.org/#/c/508522/

Change-Id: I09095ca8bb36420f77cd2e372d7b478f28930fc8
Depends-On: I4c82a63baabd6b9304b302c97cd751a0103d8316
Closes-Bug: #1759098
tags/13.0.0
ZhongShengping 1 year ago
parent
commit
0f3ff5e948

+ 16
- 3
manifests/api/authtoken.pp View File

@@ -42,7 +42,7 @@
42 42
 #   (Optional) Authentication type to load
43 43
 #   Defaults to 'password'.
44 44
 #
45
-# [*auth_uri*]
45
+# [*www_authenticate_uri*]
46 46
 #   (Optional) Complete public Identity API endpoint.
47 47
 #   Defaults to 'http://127.0.0.1:5000'.
48 48
 #
@@ -178,6 +178,12 @@
178 178
 #   (in seconds). Set to -1 to disable caching completely. Integer value
179 179
 #   Defaults to $::os_service_default.
180 180
 #
181
+# DEPRECATED PARAMETERS
182
+#
183
+# [*auth_uri*]
184
+#   (Optional) Complete public Identity API endpoint.
185
+#   Defaults to undef
186
+#
181 187
 class ironic::api::authtoken(
182 188
   $username                       = 'ironic',
183 189
   $password                       = $::os_service_default,
@@ -188,7 +194,7 @@ class ironic::api::authtoken(
188 194
   $insecure                       = $::os_service_default,
189 195
   $auth_section                   = $::os_service_default,
190 196
   $auth_type                      = 'password',
191
-  $auth_uri                       = 'http://127.0.0.1:5000',
197
+  $www_authenticate_uri           = 'http://127.0.0.1:5000',
192 198
   $auth_version                   = $::os_service_default,
193 199
   $cache                          = $::os_service_default,
194 200
   $cafile                         = $::os_service_default,
@@ -213,6 +219,8 @@ class ironic::api::authtoken(
213 219
   $manage_memcache_package        = false,
214 220
   $region_name                    = $::os_service_default,
215 221
   $token_cache_time               = $::os_service_default,
222
+  # DEPRECATED PARAMETERS
223
+  $auth_uri                       = undef,
216 224
 ) {
217 225
 
218 226
   include ::ironic::deps
@@ -221,12 +229,17 @@ class ironic::api::authtoken(
221 229
     fail('Please set password for Ironic API service user')
222 230
   }
223 231
 
232
+  if $auth_uri {
233
+    warning('The auth_uri parameter is deprecated. Please use www_authenticate_uri instead.')
234
+  }
235
+  $www_authenticate_uri_real = pick($auth_uri, $www_authenticate_uri)
236
+
224 237
   keystone::resource::authtoken { 'ironic_config':
225 238
     username                       => $username,
226 239
     password                       => $password,
227 240
     project_name                   => $project_name,
228 241
     auth_url                       => $auth_url,
229
-    auth_uri                       => $auth_uri,
242
+    www_authenticate_uri           => $www_authenticate_uri_real,
230 243
     auth_version                   => $auth_version,
231 244
     auth_type                      => $auth_type,
232 245
     auth_section                   => $auth_section,

+ 16
- 3
manifests/inspector/authtoken.pp View File

@@ -42,7 +42,7 @@
42 42
 #   (Optional) Authentication type to load
43 43
 #   Defaults to 'password'.
44 44
 #
45
-# [*auth_uri*]
45
+# [*www_authenticate_uri*]
46 46
 #   (Optional) Complete public Identity API endpoint.
47 47
 #   Defaults to 'http://127.0.0.1:5000'.
48 48
 #
@@ -178,6 +178,12 @@
178 178
 #   (in seconds). Set to -1 to disable caching completely. Integer value
179 179
 #   Defaults to $::os_service_default.
180 180
 #
181
+# DEPRECATED PARAMETERS
182
+#
183
+# [*auth_uri*]
184
+#   (Optional) Complete public Identity API endpoint.
185
+#   Defaults to undef
186
+#
181 187
 class ironic::inspector::authtoken(
182 188
   $username                       = 'ironic',
183 189
   $password                       = $::os_service_default,
@@ -188,7 +194,7 @@ class ironic::inspector::authtoken(
188 194
   $insecure                       = $::os_service_default,
189 195
   $auth_section                   = $::os_service_default,
190 196
   $auth_type                      = 'password',
191
-  $auth_uri                       = 'http://127.0.0.1:5000',
197
+  $www_authenticate_uri           = 'http://127.0.0.1:5000',
192 198
   $auth_version                   = $::os_service_default,
193 199
   $cache                          = $::os_service_default,
194 200
   $cafile                         = $::os_service_default,
@@ -213,6 +219,8 @@ class ironic::inspector::authtoken(
213 219
   $manage_memcache_package        = false,
214 220
   $region_name                    = $::os_service_default,
215 221
   $token_cache_time               = $::os_service_default,
222
+  # DEPRECATED PARAMETERS
223
+  $auth_uri                       = undef,
216 224
 ) {
217 225
 
218 226
   include ::ironic::deps
@@ -221,12 +229,17 @@ class ironic::inspector::authtoken(
221 229
     fail('Please set password for Ironic Inspector service user')
222 230
   }
223 231
 
232
+  if $auth_uri {
233
+    warning('The auth_uri parameter is deprecated. Please use www_authenticate_uri instead.')
234
+  }
235
+  $www_authenticate_uri_real = pick($auth_uri, $www_authenticate_uri)
236
+
224 237
   keystone::resource::authtoken { 'ironic_inspector_config':
225 238
     username                       => $username,
226 239
     password                       => $password,
227 240
     project_name                   => $project_name,
228 241
     auth_url                       => $auth_url,
229
-    auth_uri                       => $auth_uri,
242
+    www_authenticate_uri           => $www_authenticate_uri_real,
230 243
     auth_version                   => $auth_version,
231 244
     auth_type                      => $auth_type,
232 245
     auth_section                   => $auth_section,

+ 4
- 0
releasenotes/notes/deprecate_auth_uri_parameter-9c3b5d66452043fa.yaml View File

@@ -0,0 +1,4 @@
1
+---
2
+deprecations:
3
+  - auth_uri is deprecated and will be removed in a future release.
4
+    Please use www_authenticate_uri instead.

+ 3
- 3
spec/classes/ironic_api_authtoken_spec.rb View File

@@ -20,7 +20,7 @@ describe 'ironic::api::authtoken' do
20 20
         is_expected.to contain_ironic_config('keystone_authtoken/insecure').with_value('<SERVICE DEFAULT>')
21 21
         is_expected.to contain_ironic_config('keystone_authtoken/auth_section').with_value('<SERVICE DEFAULT>')
22 22
         is_expected.to contain_ironic_config('keystone_authtoken/auth_type').with_value('password')
23
-        is_expected.to contain_ironic_config('keystone_authtoken/auth_uri').with_value('http://127.0.0.1:5000')
23
+        is_expected.to contain_ironic_config('keystone_authtoken/www_authenticate_uri').with_value('http://127.0.0.1:5000')
24 24
         is_expected.to contain_ironic_config('keystone_authtoken/auth_version').with_value('<SERVICE DEFAULT>')
25 25
         is_expected.to contain_ironic_config('keystone_authtoken/cache').with_value('<SERVICE DEFAULT>')
26 26
         is_expected.to contain_ironic_config('keystone_authtoken/cafile').with_value('<SERVICE DEFAULT>')
@@ -50,7 +50,7 @@ describe 'ironic::api::authtoken' do
50 50
     context 'when overriding parameters' do
51 51
       before do
52 52
         params.merge!({
53
-          :auth_uri                       => 'https://10.0.0.1:9999/',
53
+          :www_authenticate_uri           => 'https://10.0.0.1:9999/',
54 54
           :username                       => 'myuser',
55 55
           :password                       => 'mypasswd',
56 56
           :auth_url                       => 'http://:127.0.0.1:35357',
@@ -88,7 +88,7 @@ describe 'ironic::api::authtoken' do
88 88
       end
89 89
 
90 90
       it 'configure keystone_authtoken' do
91
-        is_expected.to contain_ironic_config('keystone_authtoken/auth_uri').with_value('https://10.0.0.1:9999/')
91
+        is_expected.to contain_ironic_config('keystone_authtoken/www_authenticate_uri').with_value('https://10.0.0.1:9999/')
92 92
         is_expected.to contain_ironic_config('keystone_authtoken/username').with_value(params[:username])
93 93
         is_expected.to contain_ironic_config('keystone_authtoken/password').with_value(params[:password]).with_secret(true)
94 94
         is_expected.to contain_ironic_config('keystone_authtoken/auth_url').with_value(params[:auth_url])

+ 3
- 3
spec/classes/ironic_inspector_authtoken_spec.rb View File

@@ -20,7 +20,7 @@ describe 'ironic::inspector::authtoken' do
20 20
         is_expected.to contain_ironic_inspector_config('keystone_authtoken/insecure').with_value('<SERVICE DEFAULT>')
21 21
         is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_section').with_value('<SERVICE DEFAULT>')
22 22
         is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_type').with_value('password')
23
-        is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_uri').with_value('http://127.0.0.1:5000')
23
+        is_expected.to contain_ironic_inspector_config('keystone_authtoken/www_authenticate_uri').with_value('http://127.0.0.1:5000')
24 24
         is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_version').with_value('<SERVICE DEFAULT>')
25 25
         is_expected.to contain_ironic_inspector_config('keystone_authtoken/cache').with_value('<SERVICE DEFAULT>')
26 26
         is_expected.to contain_ironic_inspector_config('keystone_authtoken/cafile').with_value('<SERVICE DEFAULT>')
@@ -50,7 +50,7 @@ describe 'ironic::inspector::authtoken' do
50 50
     context 'when overriding parameters' do
51 51
       before do
52 52
         params.merge!({
53
-          :auth_uri                       => 'https://10.0.0.1:9999/',
53
+          :www_authenticate_uri           => 'https://10.0.0.1:9999/',
54 54
           :username                       => 'myuser',
55 55
           :password                       => 'mypasswd',
56 56
           :auth_url                       => 'http://:127.0.0.1:35357',
@@ -88,7 +88,7 @@ describe 'ironic::inspector::authtoken' do
88 88
       end
89 89
 
90 90
       it 'configure keystone_authtoken' do
91
-        is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_uri').with_value('https://10.0.0.1:9999/')
91
+        is_expected.to contain_ironic_inspector_config('keystone_authtoken/www_authenticate_uri').with_value('https://10.0.0.1:9999/')
92 92
         is_expected.to contain_ironic_inspector_config('keystone_authtoken/username').with_value(params[:username])
93 93
         is_expected.to contain_ironic_inspector_config('keystone_authtoken/password').with_value(params[:password]).with_secret(true)
94 94
         is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_url').with_value(params[:auth_url])

Loading…
Cancel
Save