diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-06-16 13:30:38 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-06-16 13:30:38 -0300 |
commit | 2410faceba2cff819f2d58f444aa8604cf95d9fc (patch) | |
tree | 6cfcf9363b34c1b96cdfcfaba80f20070d070b0f /manifests/kvm/manager/instance.pp | |
parent | 61e2ea8022db09965fd3e13304b3ad6e980278de (diff) | |
download | puppet-virtual-2410faceba2cff819f2d58f444aa8604cf95d9fc.tar.gz puppet-virtual-2410faceba2cff819f2d58f444aa8604cf95d9fc.tar.bz2 |
Initial kvm-manager support
Diffstat (limited to 'manifests/kvm/manager/instance.pp')
-rw-r--r-- | manifests/kvm/manager/instance.pp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/manifests/kvm/manager/instance.pp b/manifests/kvm/manager/instance.pp new file mode 100644 index 0000000..598e4d2 --- /dev/null +++ b/manifests/kvm/manager/instance.pp @@ -0,0 +1,25 @@ +class virtual::kvm::manager::instance( + $vg, + $size, + $ram, +) { + exec { "kvm-creator-${name}": + command => "/usr/local/sbin/kvm-creator create $name $vg $size $ram", + user => "root", + #creates => "/home/${name}/vms/${name}", + creates => "/etc/sv/kvm/${name}", + } + + user { $name: + ensure => present, + homedir => "/home/${name}", + groups => [ 'kvm' ], + require => Exec["kvm-creator-${name}"], + } + + exec { "update-service-kvm-${name}": + comand => "/usr/sbin/update-service --add /etc/sv/kvm/${name}", + creates => "/etc/service/${name}", + require => [ Exec["kvm-creator-${name}"], User["${name}"] ], + } +} |