define virtual::kvm::kvmx::instance( $size, $ram, $shell, $udev = false, ) { virtual::kvm::instance { $name: udev => $udev, shell => $shell ? { undef => '/usr/local/bin/kvmx-restricted-shell', default => $shell, }, } #exec { "kvmx-init-${name}": # command => "/usr/local/bin/kvmx init $name", # user => $name, # creates => "/home/${name}/vms/${name}/kvmxfile", # require => Virtual::Kvm::Instance["$name"], #} #exec { "kvmx-config-${name}-ram": # command => "/usr/local/bin/kvmx config $name memory $ram", # user => $name, # onlyif => "/usr/local/bin/kvmx config $name memory | grep -v memory=\"${ram}\"", # require => Exec["kvmx-init-${name}"], #} #exec { "kvmx-config-${name}-size": # command => "/usr/local/bin/kvmx config $name size $size", # user => $name, # onlyif => "/usr/local/bin/kvmx config $name size | grep -v memory=\"${size}\"", # require => Exec["kvmx-init-${name}"], #} }