From 23399416f1ba89894f65f61b436c2b0f8378e6c5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Dec 2014 16:14:05 -0400 Subject: broke up big function to describe PrivDataField --- src/Propellor/Property/Ssh.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/Ssh.hs') 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. -- cgit v1.3-2-g0d8e