diff --git a/manifests/cinder/volume.pp b/manifests/cinder/volume.pp new file mode 100644 index 0000000..3a7ebf4 --- /dev/null +++ b/manifests/cinder/volume.pp @@ -0,0 +1,33 @@ +class kickstack::cinder::volume inherits kickstack { + + include kickstack::cinder::config + + class { '::cinder::volume': } + + case $::kickstack::cinder_backend { + 'iscsi': { + $pv = "$::kickstack::cinder_lvm_pv" + $vg = "$::kickstack::cinder_lvm_vg" + physical_volume { "$pv": + ensure => present + } + volume_group { "$vg": + ensure => present, + physical_volumes => "$pv", + require => Physical_volume["$pv"] + } + class { '::cinder::volume::iscsi': + iscsi_ip_address => '0.0.0.0', + require => Volume_group["$vg"] + } + } + 'rbd': { + $rbd_secret_uuid = getvar("${fact_prefix}rbd_secret_uuid") + class { '::cinder::volume::rbd': + rbd_pool => $cinder_rbd_pool, + rbd_user => $cinder_rbd_user, + rbd_secret_uuid => $rbd_secret_uuid + } + } + } +} diff --git a/manifests/init.pp b/manifests/init.pp index 1ae7f9a..28e1817 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -33,6 +33,11 @@ class kickstack ( $keystone_service_tenant = $kickstack::params::keystone_service_tenant, $keystone_admin_email = $kickstack::params::keystone_admin_email, $keystone_admin_password = $kickstack::params::keystone_admin_password, + $cinder_backend = $kickstack::params::cinder_backend, + $cinder_lvm_pv = $kickstack::params::cinder_lvm_pv, + $cinder_lvm_vg = $kickstack::params::cinder_lvm_vg, + $cinder_rbd_pool = $kickstack::params::cinder_rbd_pool, + $cinder_rbd_user = $kickstack::params::cinder_rbd_user, ) inherits kickstack::params { include exportfact diff --git a/manifests/params.pp b/manifests/params.pp index 05ed01f..b4dc632 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -76,4 +76,18 @@ class kickstack::params { # The initial password to set for the admin user $keystone_admin_password = pick(getvar("::${variable_prefix}keystone_admin_password"),"kickstack") + # The backend to use with Cinder. Supported: iscsi (default), rbd + $cinder_backend = pick(getvar("::${variable_prefix}cinder_backend"),"iscsi") + + # The device to create the LVM physical volume on. Ignored unless $cinder_backend==iscsi. + $cinder_lvm_pv = pick(getvar("::${variable_prefix}cinder_lvm_pv"),"/dev/disk/by-partlabel/cinder-volumes") + + # The LVM volume group name to use for volumes. Ignored unless $cinder_backend==iscsi. + $cinder_lvm_vg = pick(getvar("::${variable_prefix}cinder_lvm_vg"),"cinder-volumes") + + # The RADOS pool to use for volumes. Ignored unless $cinder_backend==rbd. + $cinder_rbd_pool = pick(getvar("::${variable_prefix}cinder_rbd_pool"),"cinder-volumes") + + # The RADOS user to use for volumes. Ignored unless $cinder_backend==rbd. + $cinder_rbd_user = pick(getvar("::${variable_prefix}cinder_rbd_pool"),"cinder") }