summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Ssh.hs
diff options
context:
space:
mode:
authorJoey Hess2014-07-07 11:32:29 -0400
committerJoey Hess2014-07-07 11:32:29 -0400
commitbae7e085977f5c2470e9e1aa4f74fa44b69db456 (patch)
treee31ac3d43aa0f8c01007a3b07cb698cc3e64f8cc /src/Propellor/Property/Ssh.hs
parente53faff843a34fd3a4655cb4ee6c570f2072d73e (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Ssh.hs')
-rw-r--r--src/Propellor/Property/Ssh.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs
index 6785ede6..5a260476 100644
--- a/src/Propellor/Property/Ssh.hs
+++ b/src/Propellor/Property/Ssh.hs
@@ -5,6 +5,7 @@ module Propellor.Property.Ssh (
hasAuthorizedKeys,
restartSshd,
randomHostKeys,
+ hostKeys,
hostKey,
keyImported,
knownHost,
@@ -75,7 +76,15 @@ randomHostKeys = flagFile prop "/etc/ssh/.unique_host_keys"
ensureProperty $ scriptProperty
[ "DPKG_MAINTSCRIPT_NAME=postinst DPKG_MAINTSCRIPT_PACKAGE=openssh-server /var/lib/dpkg/info/openssh-server.postinst configure" ]
--- | Sets ssh host keys.
+-- | Sets all types of ssh host keys from the privdata.
+hostKeys :: Context -> Property
+hostKeys ctx = propertyList "known ssh host keys"
+ [ hostKey SshDsa ctx
+ , hostKey SshRsa ctx
+ , hostKey SshEcdsa ctx
+ ]
+
+-- | Sets a single ssh host key from the privdata.
hostKey :: SshKeyType -> Context -> Property
hostKey keytype context = combineProperties desc
[ installkey (SshPubKey keytype "") (install writeFile ".pub")