Merge "Allow for customization of the Ceph cluster name for Cinder"

This commit is contained in:
Zuul 2018-02-20 01:49:36 +00:00 committed by Gerrit Code Review
commit f4c54d75a1
2 changed files with 12 additions and 0 deletions

View File

@ -26,6 +26,10 @@
# (Optional) String to use as backend_host in the backend stanza
# Defaults to 'cinder::host'
#
# [*cinder_rbd_ceph_conf*]
# (Optional) The path to the Ceph cluster config file
# Defaults to '/etc/ceph/ceph.conf'
#
# [*cinder_rbd_pool_name*]
# (Optional) The name of the RBD pool to use
# Defaults to 'volumes'
@ -51,6 +55,7 @@
class tripleo::profile::base::cinder::volume::rbd (
$backend_name = hiera('cinder::backend::rbd::volume_backend_name', 'tripleo_ceph'),
$cinder_rbd_backend_host = hiera('cinder::host', 'hostgroup'),
$cinder_rbd_ceph_conf = hiera('cinder::backend::rbd::rbd_ceph_conf', '/etc/ceph/ceph.conf'),
$cinder_rbd_pool_name = 'volumes',
$cinder_rbd_extra_pools = undef,
$cinder_rbd_secret_uuid = hiera('ceph::profile::params::fsid', undef),
@ -62,6 +67,7 @@ class tripleo::profile::base::cinder::volume::rbd (
if $step >= 4 {
cinder::backend::rbd { $backend_name :
backend_host => $cinder_rbd_backend_host,
rbd_ceph_conf => $cinder_rbd_ceph_conf,
rbd_pool => $cinder_rbd_pool_name,
rbd_user => $cinder_rbd_user_name,
rbd_secret_uuid => $cinder_rbd_secret_uuid,
@ -71,6 +77,7 @@ class tripleo::profile::base::cinder::volume::rbd (
$cinder_rbd_extra_pools.each |$pool_name| {
cinder::backend::rbd { "${backend_name}_${pool_name}" :
backend_host => $cinder_rbd_backend_host,
rbd_ceph_conf => $cinder_rbd_ceph_conf,
rbd_pool => $pool_name,
rbd_user => $cinder_rbd_user_name,
rbd_secret_uuid => $cinder_rbd_secret_uuid,

View File

@ -42,6 +42,7 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do
it 'should trigger complete configuration' do
is_expected.to contain_cinder__backend__rbd('tripleo_ceph').with(
:backend_host => 'hostgroup',
:rbd_ceph_conf => '/etc/ceph/ceph.conf',
:rbd_pool => 'volumes',
:rbd_user => 'openstack',
)
@ -53,6 +54,7 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do
params.merge!({
:backend_name => 'poodles',
:cinder_rbd_backend_host => 'fe80::fc54:ff:fe9e:7846',
:cinder_rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:cinder_rbd_pool_name => 'poolname',
:cinder_rbd_extra_pools => ['aplenty', 'galore'],
:cinder_rbd_secret_uuid => 'secretuuid',
@ -62,18 +64,21 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do
it 'should trigger complete configuration' do
is_expected.to contain_cinder__backend__rbd('poodles').with(
:backend_host => 'fe80::fc54:ff:fe9e:7846',
:rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:rbd_pool => 'poolname',
:rbd_user => 'kcatsnepo',
:rbd_secret_uuid => 'secretuuid'
)
is_expected.to contain_cinder__backend__rbd('poodles_aplenty').with(
:backend_host => 'fe80::fc54:ff:fe9e:7846',
:rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:rbd_pool => 'aplenty',
:rbd_user => 'kcatsnepo',
:rbd_secret_uuid => 'secretuuid'
)
is_expected.to contain_cinder__backend__rbd('poodles_galore').with(
:backend_host => 'fe80::fc54:ff:fe9e:7846',
:rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:rbd_pool => 'galore',
:rbd_user => 'kcatsnepo',
:rbd_secret_uuid => 'secretuuid'