diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-06-16 17:08:39 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-06-16 17:08:39 -0300 |
commit | c4c471c90233945a690d6d69c2cc535ea4ead1f8 (patch) | |
tree | 63700c3fceffb68ab531c2f2f15d13f4c4d5d8f6 | |
parent | 6613ff3b8832d9ed368f92476303d823ec7137f4 (diff) | |
download | puppet-nodo-c4c471c90233945a690d6d69c2cc535ea4ead1f8.tar.gz puppet-nodo-c4c471c90233945a690d6d69c2cc535ea4ead1f8.tar.bz2 |
Manages sshkey at nodo::subsystem::virtual::instance
-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': { |