From 9c7d0922f8ef08c316d2aff34f9495d4ce0497f4 Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Fri, 16 Sep 2016 18:34:26 +0200 Subject: [PATCH] Properly handle Cinder backends The CINDER_BACKEND variable is a Hiera array, sicne multiple values are allowed. However, it was being treated as a single variable in controller.pp and ::packstack::cinder, which meant it would always use LVM as backend. This fixes bz#1376769 Change-Id: I5937d9d6cf53df806393a76c6882a6407b296929 --- packstack/puppet/modules/packstack/manifests/cinder.pp | 4 +++- packstack/puppet/templates/controller.pp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packstack/puppet/modules/packstack/manifests/cinder.pp b/packstack/puppet/modules/packstack/manifests/cinder.pp index 15c6ce371..b03e5ce57 100644 --- a/packstack/puppet/modules/packstack/manifests/cinder.pp +++ b/packstack/puppet/modules/packstack/manifests/cinder.pp @@ -3,7 +3,9 @@ class packstack::cinder () create_resources(packstack::firewall, hiera('FIREWALL_CINDER_RULES', {})) create_resources(packstack::firewall, hiera('FIREWALL_CINDER_API_RULES', {})) - case hiera('CONFIG_CINDER_BACKEND') { + $cinder_backends = hiera_array('CONFIG_CINDER_BACKEND') + + case $cinder_backends[0] { 'lvm': { $default_volume_type = 'iscsi' } 'gluster': { $default_volume_type = 'glusterfs' } 'nfs': { $default_volume_type = 'nfs' } diff --git a/packstack/puppet/templates/controller.pp b/packstack/puppet/templates/controller.pp index a45e0b105..7625f8fe0 100644 --- a/packstack/puppet/templates/controller.pp +++ b/packstack/puppet/templates/controller.pp @@ -47,7 +47,9 @@ if hiera('CONFIG_CINDER_INSTALL') == 'y' { include '::packstack::cinder::backup' } - case hiera('CONFIG_CINDER_BACKEND') { + $cinder_backends = hiera_array('CONFIG_CINDER_BACKEND') + + case $cinder_backends[0] { 'lvm': { include '::packstack::cinder::backend::lvm' } 'gluster': { include '::packstack::cinder::backend::gluster' } 'nfs': { include '::packstack::cinder::backend::nfs' }