Allow for customization of the Ceph cluster name for Cinder

Provides necessary 'passthrough' to configure the Ceph cluster
name to the Cinder RBD backend.

Change-Id: I8d5293eaaf104b6374dfa13992a67ddc37397f10
This commit is contained in:
Giulio Fidente 2018-02-12 12:45:11 +01:00
parent 6a29521c93
commit e13c3d4a80
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 # (Optional) String to use as backend_host in the backend stanza
# Defaults to 'cinder::host' # 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*] # [*cinder_rbd_pool_name*]
# (Optional) The name of the RBD pool to use # (Optional) The name of the RBD pool to use
# Defaults to 'volumes' # Defaults to 'volumes'
@ -51,6 +55,7 @@
class tripleo::profile::base::cinder::volume::rbd ( class tripleo::profile::base::cinder::volume::rbd (
$backend_name = hiera('cinder::backend::rbd::volume_backend_name', 'tripleo_ceph'), $backend_name = hiera('cinder::backend::rbd::volume_backend_name', 'tripleo_ceph'),
$cinder_rbd_backend_host = hiera('cinder::host', 'hostgroup'), $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_pool_name = 'volumes',
$cinder_rbd_extra_pools = undef, $cinder_rbd_extra_pools = undef,
$cinder_rbd_secret_uuid = hiera('ceph::profile::params::fsid', 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 { if $step >= 4 {
cinder::backend::rbd { $backend_name : cinder::backend::rbd { $backend_name :
backend_host => $cinder_rbd_backend_host, backend_host => $cinder_rbd_backend_host,
rbd_ceph_conf => $cinder_rbd_ceph_conf,
rbd_pool => $cinder_rbd_pool_name, rbd_pool => $cinder_rbd_pool_name,
rbd_user => $cinder_rbd_user_name, rbd_user => $cinder_rbd_user_name,
rbd_secret_uuid => $cinder_rbd_secret_uuid, 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_rbd_extra_pools.each |$pool_name| {
cinder::backend::rbd { "${backend_name}_${pool_name}" : cinder::backend::rbd { "${backend_name}_${pool_name}" :
backend_host => $cinder_rbd_backend_host, backend_host => $cinder_rbd_backend_host,
rbd_ceph_conf => $cinder_rbd_ceph_conf,
rbd_pool => $pool_name, rbd_pool => $pool_name,
rbd_user => $cinder_rbd_user_name, rbd_user => $cinder_rbd_user_name,
rbd_secret_uuid => $cinder_rbd_secret_uuid, 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 it 'should trigger complete configuration' do
is_expected.to contain_cinder__backend__rbd('tripleo_ceph').with( is_expected.to contain_cinder__backend__rbd('tripleo_ceph').with(
:backend_host => 'hostgroup', :backend_host => 'hostgroup',
:rbd_ceph_conf => '/etc/ceph/ceph.conf',
:rbd_pool => 'volumes', :rbd_pool => 'volumes',
:rbd_user => 'openstack', :rbd_user => 'openstack',
) )
@ -53,6 +54,7 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do
params.merge!({ params.merge!({
:backend_name => 'poodles', :backend_name => 'poodles',
:cinder_rbd_backend_host => 'fe80::fc54:ff:fe9e:7846', :cinder_rbd_backend_host => 'fe80::fc54:ff:fe9e:7846',
:cinder_rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:cinder_rbd_pool_name => 'poolname', :cinder_rbd_pool_name => 'poolname',
:cinder_rbd_extra_pools => ['aplenty', 'galore'], :cinder_rbd_extra_pools => ['aplenty', 'galore'],
:cinder_rbd_secret_uuid => 'secretuuid', :cinder_rbd_secret_uuid => 'secretuuid',
@ -62,18 +64,21 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do
it 'should trigger complete configuration' do it 'should trigger complete configuration' do
is_expected.to contain_cinder__backend__rbd('poodles').with( is_expected.to contain_cinder__backend__rbd('poodles').with(
:backend_host => 'fe80::fc54:ff:fe9e:7846', :backend_host => 'fe80::fc54:ff:fe9e:7846',
:rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:rbd_pool => 'poolname', :rbd_pool => 'poolname',
:rbd_user => 'kcatsnepo', :rbd_user => 'kcatsnepo',
:rbd_secret_uuid => 'secretuuid' :rbd_secret_uuid => 'secretuuid'
) )
is_expected.to contain_cinder__backend__rbd('poodles_aplenty').with( is_expected.to contain_cinder__backend__rbd('poodles_aplenty').with(
:backend_host => 'fe80::fc54:ff:fe9e:7846', :backend_host => 'fe80::fc54:ff:fe9e:7846',
:rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:rbd_pool => 'aplenty', :rbd_pool => 'aplenty',
:rbd_user => 'kcatsnepo', :rbd_user => 'kcatsnepo',
:rbd_secret_uuid => 'secretuuid' :rbd_secret_uuid => 'secretuuid'
) )
is_expected.to contain_cinder__backend__rbd('poodles_galore').with( is_expected.to contain_cinder__backend__rbd('poodles_galore').with(
:backend_host => 'fe80::fc54:ff:fe9e:7846', :backend_host => 'fe80::fc54:ff:fe9e:7846',
:rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:rbd_pool => 'galore', :rbd_pool => 'galore',
:rbd_user => 'kcatsnepo', :rbd_user => 'kcatsnepo',
:rbd_secret_uuid => 'secretuuid' :rbd_secret_uuid => 'secretuuid'