summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-10 11:45:14 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-10 13:02:52 +0100
commit754a6ae63ad336c568d8adaed651de5c24d5736b (patch)
treec02762752f4c8835b06ccc8e4773eda1c33e9462
parentLetsencrypt improvements (diff)
downloadwebdav_server-754a6ae63ad336c568d8adaed651de5c24d5736b.tar.gz
webdav_server-754a6ae63ad336c568d8adaed651de5c24d5736b.tar.xz
Replace homewritten ssh module with pre-made one.
-rw-r--r--.gitmodules3
m---------modules/ssh0
-rw-r--r--modules/ssh/manifests/init.pp45
3 files changed, 3 insertions, 45 deletions
diff --git a/.gitmodules b/.gitmodules
index 17ff4d5..31de632 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -67,3 +67,6 @@
[submodule "modules/hash2stuff"]
path = modules/hash2stuff
url = https://github.com/mmckinst/puppet-hash2stuff
+[submodule "modules/ssh"]
+ path = modules/ssh
+ url = https://github.com/saz/puppet-ssh
diff --git a/modules/ssh b/modules/ssh
new file mode 160000
+Subproject b84d4dcea802ce0a12e7d1d96bd71e993cd579b
diff --git a/modules/ssh/manifests/init.pp b/modules/ssh/manifests/init.pp
deleted file mode 100644
index 8a50ef1..0000000
--- a/modules/ssh/manifests/init.pp
+++ /dev/null
@@ -1,45 +0,0 @@
-class ssh (
- Variant[Enum['prohibit-password'], Boolean] $permit_root_login = false,
- Array[String] $authorized_keys = [],
-) {
-
- $pkgs = $facts['os']['family'] ? {
- 'Debian' => ['openssh-server'],
- 'Archlinux' => ['openssh'],
- }
-
- ensure_packages($pkgs)
-
- $root_login = $permit_root_login ? {
- 'prohibit-password' => 'prohibit-password',
- true => 'yes',
- false => 'no',
- }
-
- file_line { 'sshd permit_root_login':
- ensure => present,
- path => '/etc/ssh/sshd_config',
- line => "PermitRootLogin ${root_login}",
- 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,
- # content => epp('ssh/sshd_config.epp'),
- # }
-}