aboutsummaryrefslogtreecommitdiff
path: root/manifests/kvm/kvmx/instance.pp
blob: 76d1bb3d6a74e6e26b2a5e8284f284bbe4489c25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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}"],
  #}
}