summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Ssh.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2014-12-17 16:31:09 -0400
committerJoey Hess <joeyh@joeyh.name>2014-12-17 16:31:09 -0400
commit8cc691dc868f1f43d985fea012dc84183b70341d (patch)
treeab8485a66aa75c15e7dfdd2f00ab6011786e6b2d /src/Propellor/Property/Ssh.hs
parentdb3f9050d6f4a098b82ae014a6a6e5e96a3067f6 (diff)
parentddeee3ceb8ef5aa94ffc0696bff085eb031309d6 (diff)
Merge branch 'joeyconfig'
Conflicts: privdata.joey/privdata.gpg
Diffstat (limited to 'src/Propellor/Property/Ssh.hs')
-rw-r--r--src/Propellor/Property/Ssh.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs
index fcae6498..695b67cb 100644
--- a/src/Propellor/Property/Ssh.hs
+++ b/src/Propellor/Property/Ssh.hs
@@ -90,8 +90,8 @@ hostKeys ctx = propertyList "known ssh host keys"
-- | Sets a single ssh host key from the privdata.
hostKey :: IsContext c => SshKeyType -> c -> Property
hostKey keytype context = combineProperties desc
- [ installkey (SshPubKey keytype "") (install writeFile ".pub")
- , installkey (SshPrivKey keytype "") (install writeFileProtected "")
+ [ installkey (keysrc ".pub" (SshPubKey keytype "")) (install writeFile ".pub")
+ , installkey (keysrc "" (SshPrivKey keytype "")) (install writeFileProtected "")
]
`onChange` restarted
where
@@ -104,6 +104,8 @@ hostKey keytype context = combineProperties desc
if s == key
then noChange
else makeChange $ writer f key
+ keysrc ext field = PrivDataSourceFileFromCommand field ("sshkey"++ext)
+ ("ssh-keygen -t " ++ sshKeyTypeParam keytype ++ " -f sshkey")
-- | Sets up a user with a ssh private key and public key pair from the
-- PrivData.