aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-31 18:16:55 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-31 18:16:55 -0200
commit7a30f0004bd13d51f6320d1ef116d89927cc3bea (patch)
treef77f0f36ad7f0e304cca4ffb87190b858eeed079
parent52836975bd7d7912de87cc1c8e4a8560acfb47c0 (diff)
downloadpuppet-virtual-7a30f0004bd13d51f6320d1ef116d89927cc3bea.tar.gz
puppet-virtual-7a30f0004bd13d51f6320d1ef116d89927cc3bea.tar.bz2
Adds virtual::kvm::kvmx::instance
-rw-r--r--manifests/kvm/kvmx/instance.pp35
-rw-r--r--manifests/kvm/manager/instance.pp2
2 files changed, 36 insertions, 1 deletions
diff --git a/manifests/kvm/kvmx/instance.pp b/manifests/kvm/kvmx/instance.pp
new file mode 100644
index 0000000..76d1bb3
--- /dev/null
+++ b/manifests/kvm/kvmx/instance.pp
@@ -0,0 +1,35 @@
+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}"],
+ #}
+}
diff --git a/manifests/kvm/manager/instance.pp b/manifests/kvm/manager/instance.pp
index c9ecff9..76bb2aa 100644
--- a/manifests/kvm/manager/instance.pp
+++ b/manifests/kvm/manager/instance.pp
@@ -17,7 +17,7 @@ define virtual::kvm::manager::instance(
require => [ Exec["kvm-creator-${name}"], User["${name}"] ],
}
- virtual::kvmx::instance { "$name":
+ virtual::kvm::instance { "$name":
udev => $udev,
require => Exec["kvm-creator-${name}"],
}