summaryrefslogtreecommitdiff
path: root/Propellor/Property/Ssh.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-13 03:21:02 -0400
committerJoey Hess2014-04-13 03:21:02 -0400
commit427246db6a6dc1d626297cf0af6f372a3c75486f (patch)
treef7290b6dd7cf9722d5231f5fef57bd815af51e48 /Propellor/Property/Ssh.hs
parent90a6a6cb5800bc41395bff09fc7090eba41c3b14 (diff)
propellor spin
Diffstat (limited to 'Propellor/Property/Ssh.hs')
-rw-r--r--Propellor/Property/Ssh.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Propellor/Property/Ssh.hs b/Propellor/Property/Ssh.hs
index 51bb7c14..426e286e 100644
--- a/Propellor/Property/Ssh.hs
+++ b/Propellor/Property/Ssh.hs
@@ -85,7 +85,7 @@ hostKey keytype = propertyList desc
, Property desc (install writeFileProtected (SshPrivKey keytype "") "")
]
where
- desc = "known ssh host key"
+ desc = "known ssh host key (" ++ fromKeyType keytype ++ ")"
install writer p ext = withPrivData p $ \key -> do
let f = "/etc/ssh/ssh_host_" ++ fromKeyType keytype ++ "key" ++ ext
void $ liftIO $ writer f key
@@ -99,7 +99,7 @@ keyImported keytype user = propertyList desc
, Property desc (install writeFileProtected (SshPrivKey keytype user) "")
]
where
- desc = user ++ " has ssh key"
+ desc = user ++ " has ssh key (" ++ fromKeyType keytype ++ ")"
install writer p ext = do
f <- liftIO $ keyfile ext
ifM (liftIO $ doesFileExist f)
@@ -136,5 +136,6 @@ authorizedKeys :: UserName -> Property
authorizedKeys user = Property (user ++ " has authorized_keys") $
withPrivData (SshAuthorizedKeys user) $ \v -> liftIO $ do
f <- liftIO $ dotFile "authorized_keys" user
+ createDirectoryIfMissing True (takeDirectory f)
writeFileProtected f v
return NoChange