Add possibility to manage volume_name_template
Fixes-bug: PROD-35997
Change-Id: Ifc023a1dd490e794fa73e59be246e8bdd03b8b7c
diff --git a/README.rst b/README.rst
index 6e4739b..ac0210e 100644
--- a/README.rst
+++ b/README.rst
@@ -1045,6 +1045,15 @@
volume:create:
+Change default volume name template:
+====================================
+
+.. code-block:: yaml
+
+ cinder:
+ volume_name_template: 'custom-volume-name-%s'
+
+
Upgrades
========
diff --git a/cinder/files/pike/cinder.conf.controller.Debian b/cinder/files/pike/cinder.conf.controller.Debian
index b2115cd..4937fea 100644
--- a/cinder/files/pike/cinder.conf.controller.Debian
+++ b/cinder/files/pike/cinder.conf.controller.Debian
@@ -16,7 +16,7 @@
api_paste_confg = /etc/cinder/api-paste.ini
iscsi_helper = tgtadm
-volume_name_template = volume-%s
+volume_name_template = {{ pillar.get('cinder', {}).get('volume_name_template', 'volume-%s') }}
#volume_group = cinder
verbose = True
@@ -97,7 +97,7 @@
-volume_name_template = volume-%s
+volume_name_template = {{ pillar.get('cinder', {}).get('volume_name_template', 'volume-%s') }}
#volume_group = vg_cinder_volume
diff --git a/cinder/files/pike/cinder.conf.volume.Debian b/cinder/files/pike/cinder.conf.volume.Debian
index 4900816..e540b12 100644
--- a/cinder/files/pike/cinder.conf.volume.Debian
+++ b/cinder/files/pike/cinder.conf.volume.Debian
@@ -16,7 +16,7 @@
api_paste_confg = /etc/cinder/api-paste.ini
iscsi_helper = tgtadm
-volume_name_template = volume-%s
+volume_name_template = {{ pillar.get('cinder', {}).get('volume_name_template', 'volume-%s') }}
#volume_group = cinder
verbose = True
@@ -91,7 +91,7 @@
volume_clear={{ volume.wipe_method }}
-volume_name_template = volume-%s
+volume_name_template = {{ pillar.get('cinder', {}).get('volume_name_template', 'volume-%s') }}
#volume_group = vg_cinder_volume
diff --git a/cinder/files/queens/cinder.conf.controller.Debian b/cinder/files/queens/cinder.conf.controller.Debian
index 0357993..0714687 100644
--- a/cinder/files/queens/cinder.conf.controller.Debian
+++ b/cinder/files/queens/cinder.conf.controller.Debian
@@ -477,7 +477,7 @@
#enable_new_services = true
# Template string to be used to generate volume names (string value)
-volume_name_template = volume-%s
+volume_name_template = {{ pillar.get('cinder', {}).get('volume_name_template', 'volume-%s') }}
# Template string to be used to generate snapshot names (string value)
#snapshot_name_template = snapshot-%s
diff --git a/cinder/files/queens/cinder.conf.volume.Debian b/cinder/files/queens/cinder.conf.volume.Debian
index 872ea25..0b32720 100644
--- a/cinder/files/queens/cinder.conf.volume.Debian
+++ b/cinder/files/queens/cinder.conf.volume.Debian
@@ -471,7 +471,7 @@
#enable_new_services = true
# Template string to be used to generate volume names (string value)
-volume_name_template = volume-%s
+volume_name_template = {{ pillar.get('cinder', {}).get('volume_name_template', 'volume-%s') }}
# Template string to be used to generate snapshot names (string value)
#snapshot_name_template = snapshot-%s