Browse Source

Merge "Configure cinder's default volume type" into stable/queens

tags/8.5.1
Zuul 1 month ago
parent
commit
930b8f0b8f

+ 11
- 0
manifests/profile/base/cinder/api.pp View File

@@ -49,6 +49,10 @@
49 49
 #   specified.
50 50
 #   Defaults to hiera('cinder::api::keymgr_backend', 'cinder.keymgr.conf_key_mgr.ConfKeyManager')
51 51
 #
52
+# [*default_volume_type*]
53
+#   (Optional) The name of the default volume type.
54
+#   Defaults to hiera('cinder::api::default_volume_type', '')
55
+#
52 56
 # [*step*]
53 57
 #   (Optional) The current step in deployment. See tripleo-heat-templates
54 58
 #   for more details.
@@ -68,14 +72,17 @@ class tripleo::profile::base::cinder::api (
68 72
   $cinder_api_network            = hiera('cinder_api_network', undef),
69 73
   $enable_internal_tls           = hiera('enable_internal_tls', false),
70 74
   $keymgr_backend                = hiera('cinder::api::keymgr_backend', 'cinder.keymgr.conf_key_mgr.ConfKeyManager'),
75
+  $default_volume_type           = hiera('cinder::api::default_volume_type', ''),
71 76
   $step                          = Integer(hiera('step')),
72 77
   # DEPRECATED PARAMETERS
73 78
   $keymgr_api_class              = undef,
74 79
 ) {
75 80
   if $::hostname == downcase($bootstrap_node) {
76 81
     $sync_db = true
82
+    $manage_type = true
77 83
   } else {
78 84
     $sync_db = false
85
+    $manage_type = false
79 86
   }
80 87
 
81 88
   include ::tripleo::profile::base::cinder
@@ -111,4 +118,8 @@ class tripleo::profile::base::cinder::api (
111 118
     include ::cinder::ceilometer
112 119
   }
113 120
 
121
+  if $step == 4 and $manage_type and $default_volume_type != '' {
122
+    cinder::type { $default_volume_type : }
123
+  }
124
+
114 125
 }

+ 6
- 0
releasenotes/notes/cinder-default-volume-type-a344cea7ab4b4b2a.yaml View File

@@ -0,0 +1,6 @@
1
+---
2
+features:
3
+  - |
4
+    Add the ability to create Cinder's default volume type. This capability
5
+    will be used to fix `bug 1782217
6
+    <https://bugs.launchpad.net/tripleo/+bug/1782217>`__.

+ 3
- 1
spec/classes/tripleo_profile_base_cinder_api_spec.rb View File

@@ -77,6 +77,7 @@ describe 'tripleo::profile::base::cinder::api' do
77 77
           :keymgr_backend => 'castellan.key_manager.barbican_key_manager.BarbicanKeyManager',
78 78
         )
79 79
         is_expected.to contain_class('cinder::ceilometer')
80
+        is_expected.to contain_cinder__type('tripleo')
80 81
       end
81 82
     end
82 83
 
@@ -86,12 +87,13 @@ describe 'tripleo::profile::base::cinder::api' do
86 87
         :bootstrap_node => 'other.example.com',
87 88
       } }
88 89
 
89
-      it 'should trigger complete configuration but with no db sync' do
90
+      it 'should trigger complete configuration but with no db sync or default volume type' do
90 91
         is_expected.to contain_class('cinder::api').with(
91 92
           :sync_db        => false,
92 93
           :keymgr_backend => 'castellan.key_manager.barbican_key_manager.BarbicanKeyManager',
93 94
         )
94 95
         is_expected.to contain_class('cinder::ceilometer')
96
+        is_expected.to_not contain_cinder__type('tripleo')
95 97
       end
96 98
     end
97 99
 

+ 1
- 0
spec/fixtures/hieradata/step4.yaml View File

@@ -1,5 +1,6 @@
1 1
 ---
2 2
 step: 4
3
+cinder::api::default_volume_type: 'tripleo'
3 4
 cinder::api::keymgr_backend: 'castellan.key_manager.barbican_key_manager.BarbicanKeyManager'
4 5
 nova::compute::keymgr_backend: 'castellan.key_manager.barbican_key_manager.BarbicanKeyManager'
5 6
 # items needed for tripleo::profile::base::cinder::volume

Loading…
Cancel
Save