Merge "Do not create cinder-volumes if not needed"
This commit is contained in:
@@ -1,13 +1,16 @@
|
|||||||
class { 'cinder::setup_test_volume':
|
$create_cinder_volume = hiera('CONFIG_CINDER_VOLUMES_CREATE')
|
||||||
|
|
||||||
|
if $create_cinder_volume == 'y' {
|
||||||
|
class { 'cinder::setup_test_volume':
|
||||||
size => hiera('CONFIG_CINDER_VOLUMES_SIZE'),
|
size => hiera('CONFIG_CINDER_VOLUMES_SIZE'),
|
||||||
loopback_device => '/dev/loop2',
|
loopback_device => '/dev/loop2',
|
||||||
volume_path => '/var/lib/cinder',
|
volume_path => '/var/lib/cinder',
|
||||||
volume_name => 'cinder-volumes',
|
volume_name => 'cinder-volumes',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add loop device on boot
|
# Add loop device on boot
|
||||||
$el_releases = ['RedHat', 'CentOS', 'Scientific']
|
$el_releases = ['RedHat', 'CentOS', 'Scientific']
|
||||||
if $::operatingsystem in $el_releases and $::operatingsystemmajrelease < 7 {
|
if $::operatingsystem in $el_releases and $::operatingsystemmajrelease < 7 {
|
||||||
|
|
||||||
file_line{ 'rc.local_losetup_cinder_volume':
|
file_line{ 'rc.local_losetup_cinder_volume':
|
||||||
path => '/etc/rc.d/rc.local',
|
path => '/etc/rc.d/rc.local',
|
||||||
@@ -19,7 +22,7 @@ if $::operatingsystem in $el_releases and $::operatingsystemmajrelease < 7 {
|
|||||||
mode => '0755',
|
mode => '0755',
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
file { 'openstack-losetup':
|
file { 'openstack-losetup':
|
||||||
path => '/usr/lib/systemd/system/openstack-losetup.service',
|
path => '/usr/lib/systemd/system/openstack-losetup.service',
|
||||||
@@ -53,7 +56,14 @@ RequiredBy=openstack-cinder-volume.service',
|
|||||||
require => Class['cinder::setup_test_volume'],
|
require => Class['cinder::setup_test_volume'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
package {'lvm2':
|
||||||
|
ensure => 'present',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
file_line { 'snapshot_autoextend_threshold':
|
file_line { 'snapshot_autoextend_threshold':
|
||||||
path => '/etc/lvm/lvm.conf',
|
path => '/etc/lvm/lvm.conf',
|
||||||
@@ -74,6 +84,8 @@ cinder::backend::iscsi { 'lvm':
|
|||||||
require => Package['lvm2'],
|
require => Package['lvm2'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cinder::type { 'iscsi':
|
cinder::type { 'iscsi':
|
||||||
set_key => 'volume_backend_name',
|
set_key => 'volume_backend_name',
|
||||||
set_value => 'lvm',
|
set_value => 'lvm',
|
||||||
|
|||||||
Reference in New Issue
Block a user