From e782bd3b16acb41948f7386add8af6902b21f741 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 10 Jun 2018 13:55:06 -0300 Subject: Adds virtual::kvm::kvmx::config --- manifests/kvm/kvmx/instance.pp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/manifests/kvm/kvmx/instance.pp b/manifests/kvm/kvmx/instance.pp index ee1dac3..edbab91 100644 --- a/manifests/kvm/kvmx/instance.pp +++ b/manifests/kvm/kvmx/instance.pp @@ -29,25 +29,15 @@ define virtual::kvm::kvmx::instance( require => Virtual::Kvm::Instance["$name"], } - exec { "kvmx-config-${name}-ram": - #command => "/usr/local/bin/kvmx $name config memory ${ram}", - command => "/usr/local/bin/kvmx config memory ${ram}", - user => $name, - environment => [ "HOME=/home/${name}" ], - cwd => "/home/${name}/vms/${name}", - #onlyif => "/usr/local/bin/kvmx config ${name} memory | grep -v memory=\"${ram}\"", - onlyif => "/usr/local/bin/kvmx config ${name} memory | grep -v ^${ram}", - require => Exec["kvmx-init-${name}"], + virtual::kvm::kvmx::config { "${name}-memory": + vm => $name, + param => 'memory', + value => $ram, } - exec { "kvmx-config-${name}-size": - #command => "/usr/local/bin/kvmx ${name} config size ${size}", - command => "/usr/local/bin/kvmx config size ${size}", - user => $name, - environment => [ "HOME=/home/${name}" ], - cwd => "/home/${name}/vms/${name}", - #onlyif => "/usr/local/bin/kvmx config ${name} size | grep -v memory=\"${size}\"", - onlyif => "/usr/local/bin/kvmx config ${name} size | grep -v ^${size}", - require => Exec["kvmx-init-${name}"], + virtual::kvm::kvmx::config { "${name}-size": + vm => $name, + param => 'size', + value => $size, } } -- cgit v1.2.3