puppet-cinder/manifests/setup_test_volume.pp
Dan Bode e67394639e add test class
This commit adds a class for testing that creates
a volume on a loopback device.
2012-10-25 17:42:46 -07:00

29 lines
570 B
Puppet

class cinder::setup_test_volume(
$volume_name = 'cinder-volumes',
$size = '4G',
$loopback_device = '/dev/loop2'
) {
Exec {
cwd => '/tmp/',
}
exec { "/bin/dd if=/dev/zero of=${volume_name} bs=1 count=0 seek=${size}":
unless => "/sbin/vgdisplay ${volume_name}"
} ~>
exec { "/sbin/losetup ${loopback_device} ${volume_name}":
refreshonly => true,
} ~>
exec { "/sbin/pvcreate ${loopback_device}":
refreshonly => true,
} ~>
exec { "/sbin/vgcreate ${volume_name} ${loopback_device}":
refreshonly => true,
}
}