summaryrefslogtreecommitdiff
path: root/modules/ssh/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ssh/manifests/init.pp')
-rw-r--r--modules/ssh/manifests/init.pp15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/ssh/manifests/init.pp b/modules/ssh/manifests/init.pp
index 8db8eef..8a50ef1 100644
--- a/modules/ssh/manifests/init.pp
+++ b/modules/ssh/manifests/init.pp
@@ -1,5 +1,6 @@
class ssh (
Variant[Enum['prohibit-password'], Boolean] $permit_root_login = false,
+ Array[String] $authorized_keys = [],
) {
$pkgs = $facts['os']['family'] ? {
@@ -22,6 +23,20 @@ class ssh (
match => '^#? *PermitRootLogin ',
}
+ file { '/root/.ssh':
+ ensure => directory,
+ }
+
+ file { '/root/.ssh/authorized_keys':
+ ensure => file,
+ }
+
+ $authorized_keys.each |$key| {
+ file_line { "Authorize ssh key ${key}":
+ path => '/root/.ssh/authorized_keys',
+ line => $key,
+ }
+ }
# file { '/etc/ssh/sshd_config':
# ensure => file,