aboutsummaryrefslogtreecommitdiff
path: root/manifests/defines
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-16 14:59:21 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-16 14:59:21 -0300
commit1991dd84c5b0f181a94a2db6915420d87a1bd46a (patch)
tree0ae0b56b856c173f7b0c5a33f4a88d30e0aeda4c /manifests/defines
parentbf7f099210a8e92c253ef2bdced93ad4811c042e (diff)
downloadpuppet-nodo-1991dd84c5b0f181a94a2db6915420d87a1bd46a.tar.gz
puppet-nodo-1991dd84c5b0f181a94a2db6915420d87a1bd46a.tar.bz2
Adding ssh_local_key define
Diffstat (limited to 'manifests/defines')
-rw-r--r--manifests/defines/ssh_local_key.pp20
1 files changed, 20 insertions, 0 deletions
diff --git a/manifests/defines/ssh_local_key.pp b/manifests/defines/ssh_local_key.pp
new file mode 100644
index 0000000..db02b0b
--- /dev/null
+++ b/manifests/defines/ssh_local_key.pp
@@ -0,0 +1,20 @@
+# Manage local ssh keys
+define ssh_local_key(
+ $owner = $name,
+ $group = $name,
+ $home = '/home/$owner',
+ $source = "puppet:///modules/site_keys/${name}_id_rsa",
+ $dest = 'id-rsa',
+ $ensure = 'present',
+) {
+ include nodo::subsystem::ssh_folder
+
+ file { "${home}/.ssh/${dest}":
+ ensure => $ensure,
+ owner => $owner,
+ group => $group,
+ mode => 0400,
+ source => "$source",
+ require => File["${home}/.ssh"],
+ }
+}