edit the share testing .pp

not confirmed to work
This commit is contained in:
Ryan Hefner 2014-08-23 19:53:14 -04:00
parent 421875bda8
commit d412f40e2c

View File

@ -1,3 +1,4 @@
#NTAP: this needs to be tweaked - no idea what to put here
# == Class: manila::setup_test_share # == Class: manila::setup_test_share
# #
# Setup a share group on a loop device for test purposes. # Setup a share group on a loop device for test purposes.
@ -13,33 +14,45 @@
# [*loopback_device*] # [*loopback_device*]
# Loop device name. Defaults to '/dev/loop2'. # Loop device name. Defaults to '/dev/loop2'.
# #
# [*share_path*]
# Share image location. Defaults to '/var/lib/manila'.
class manila::setup_test_share( class manila::setup_test_share(
$share_name = 'manila-shares', $share_name = 'manila-shares',
$share_path = '/var/lib/manila',
$size = '4G', $size = '4G',
$loopback_device = '/dev/loop2' $loopback_device = '/dev/loop2'
) { ) {
Exec { package { 'nfs-utils':
cwd => '/tmp/',
}
package { 'lvm2':
ensure => present, ensure => present,
} ~> } ~>
exec { "/bin/dd if=/dev/zero of=${share_name} bs=1 count=0 seek=${size}": file { $share_path:
unless => "/sbin/vgdisplay ${share_name}" ensure => directory,
owner => 'manila',
group => 'manila',
require => Package['manila'],
} ~> } ~>
exec { "/sbin/losetup ${loopback_device} ${share_name}": exec { "create_${share_path}/${share_name}":
command => "dd if=/dev/zero of=\"${share_path}/${share_name}\" bs=1 count=0 seek=${size}",
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
unless => "stat ${share_path}/${share_name}",
} ~>
exec { "losetup ${loopback_device} ${share_path}/${share_name}":
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
refreshonly => true, refreshonly => true,
} ~> } ~>
exec { "/sbin/pvcreate ${loopback_device}": exec { "pvcreate ${loopback_device}":
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
unless => "pvdisplay | grep ${share_name}",
refreshonly => true, refreshonly => true,
} ~> } ~>
exec { "/sbin/vgcreate ${share_name} ${loopback_device}": exec { "vgcreate ${share_name} ${loopback_device}":
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
refreshonly => true, refreshonly => true,
} }