summaryrefslogtreecommitdiffstats
path: root/roles/lib_utils
diff options
context:
space:
mode:
Diffstat (limited to 'roles/lib_utils')
-rw-r--r--roles/lib_utils/action_plugins/generate_pv_pvcs_list.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/roles/lib_utils/action_plugins/generate_pv_pvcs_list.py b/roles/lib_utils/action_plugins/generate_pv_pvcs_list.py
index eb13a58ba..c60742dd3 100644
--- a/roles/lib_utils/action_plugins/generate_pv_pvcs_list.py
+++ b/roles/lib_utils/action_plugins/generate_pv_pvcs_list.py
@@ -118,10 +118,16 @@ class ActionModule(ActionBase):
create_pvc = self._templar.template(create_pvc)
if kind != 'object' and create_pv and create_pvc:
volume, size, _, access_modes = self.build_common(varname=varname)
+ storageclass = self.task_vars.get(str(varname) + '_storageclass')
+ if storageclass:
+ storageclass = self._templar.template(storageclass)
+ elif storageclass is None and kind != 'dynamic':
+ storageclass = ''
return dict(
name="{0}-claim".format(volume),
capacity=size,
- access_modes=access_modes)
+ access_modes=access_modes,
+ storageclass=storageclass)
return None
def run(self, tmp=None, task_vars=None):