diff options
Diffstat (limited to 'manifests/subsystem')
-rw-r--r-- | manifests/subsystem/virtual/instance.pp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/manifests/subsystem/virtual/instance.pp b/manifests/subsystem/virtual/instance.pp index 4eaa468..048f394 100644 --- a/manifests/subsystem/virtual/instance.pp +++ b/manifests/subsystem/virtual/instance.pp @@ -2,12 +2,13 @@ define nodo::subsystem::virtual::instance( $vg, $context, + $iface, $ram = '1024', $size = '10G', $ensure = 'running', $implementation = 'kvmx', $shell = undef, - $supervise = 1, + $supervise = '1', $proxy = false, $web = false, $gitd = false, @@ -41,29 +42,32 @@ define nodo::subsystem::virtual::instance( size => $size, ram => $ram, udev => $udev, + iface => $iface, shell => $shell, - supervise => true, + supervise => $supervise, } } if $implementation == 'kvm-manager' { virtual::kvm::manager::instance { $name: - vg => $vg, - size => $size, - ram => $ram, - udev => $udev, + vg => $vg, + size => $size, + ram => $ram, + udev => $udev, + iface => $iface, } } - if $sshkey != '' { - ssh_authorized_key { "virtual-instance-${name}": - ensure => present, - key => $sshkey, - type => $sshkey_type, - options => $sshkey_options, - user => $name, - require => User["${name}"], - } + ssh_authorized_key { "virtual-instance-${name}": + ensure => $sshkey ? { + '' => absent, + default => present, + }, + key => $sshkey, + type => $sshkey_type, + options => $sshkey_options, + user => $name, + require => User["${name}"], } # Apply firewall rules just for running virtual machines |