summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2014-04-13 03:49:24 -0400
committerJoey Hess2014-04-13 03:49:24 -0400
commit622a3d8a931979deec838f06f7fb0311adf40df6 (patch)
tree2e0a325fe7ad5781deac663a600f2a9c24e35873
parentfe939677adf9fa7bd8311fa437c757d91b3abae6 (diff)
propellor spin
-rw-r--r--Propellor/Property/Ssh.hs7
-rw-r--r--config-joey.hs5
2 files changed, 8 insertions, 4 deletions
diff --git a/Propellor/Property/Ssh.hs b/Propellor/Property/Ssh.hs
index ba23253d..2fc3c560 100644
--- a/Propellor/Property/Ssh.hs
+++ b/Propellor/Property/Ssh.hs
@@ -84,12 +84,15 @@ hostKey keytype = propertyList desc
[ Property desc (install writeFile (SshPubKey keytype "") ".pub")
, Property desc (install writeFileProtected (SshPrivKey keytype "") "")
]
+ `onChange` restartSshd
where
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
- noChange
+ s <- liftIO $ readFileStrict f
+ if s == key
+ then noChange
+ else makeChange $ writer f key
-- | Sets up a user with a ssh private key and public key pair
-- from the site's PrivData.
diff --git a/config-joey.hs b/config-joey.hs
index dd454040..394881b4 100644
--- a/config-joey.hs
+++ b/config-joey.hs
@@ -74,7 +74,7 @@ hosts =
& Ssh.hostKey SshDsa
& Ssh.hostKey SshRsa
& Obnam.backup "/srv/git" "33 3 * * *"
- [ "--repository=sftp://2318@usw-s002.rsync.net/~/git.kitenet.net.obnam"
+ [ "--repository=sftp://2318@usw-s002.rsync.net/~/git.kitenet.net"
, "--encrypt-with=1B169BE1"
, "--client-name=wren"
] Obnam.OnlyClient
@@ -93,7 +93,8 @@ hosts =
-- downloads.kitenet.net setup (including ssh key to turtle)
& Apt.buildDep ["git-annex"] `period` Daily
- -- I don't run this system, but tell propellor its public key.
+ -- I don't run this system, so only relevant property is its
+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