diff options
Diffstat (limited to 'manifests/subsystem/virtual')
-rw-r--r-- | manifests/subsystem/virtual/instance.pp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/manifests/subsystem/virtual/instance.pp b/manifests/subsystem/virtual/instance.pp index 86b2490..5ccafbd 100644 --- a/manifests/subsystem/virtual/instance.pp +++ b/manifests/subsystem/virtual/instance.pp @@ -20,6 +20,9 @@ define nodo::subsystem::virtual::instance( $rsync = false, $avahi = false, $subnet = '10.1.1', + $sshkey = '', + $sshkey_type = 'ssh-rsa', + $sshkey_options = [], ) { # Instance id if $context <= 9 { @@ -34,6 +37,17 @@ define nodo::subsystem::virtual::instance( ram => $ram, } + if $sshkey != '' { + ssh_authorized_key { "virtual-instance-${name}": + ensure => present, + key => $sshkey, + type => $sshkey_type, + options => $sshkey_options, + user => $name, + require => User["${name}"], + } + } + # Apply firewall rules just for running virtual machines case $ensure { 'running': { |