aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystem/virtual
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-16 17:08:39 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-16 17:08:39 -0300
commitc4c471c90233945a690d6d69c2cc535ea4ead1f8 (patch)
tree63700c3fceffb68ab531c2f2f15d13f4c4d5d8f6 /manifests/subsystem/virtual
parent6613ff3b8832d9ed368f92476303d823ec7137f4 (diff)
downloadpuppet-nodo-c4c471c90233945a690d6d69c2cc535ea4ead1f8.tar.gz
puppet-nodo-c4c471c90233945a690d6d69c2cc535ea4ead1f8.tar.bz2
Manages sshkey at nodo::subsystem::virtual::instance
Diffstat (limited to 'manifests/subsystem/virtual')
-rw-r--r--manifests/subsystem/virtual/instance.pp14
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': {