aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-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"],
+ }
+}