This commit is contained in:
Joey Hess 2014-11-24 00:52:46 -04:00
parent 8d1814a884
commit 934171e2ea
1 changed files with 8 additions and 8 deletions

View File

@ -1,8 +1,8 @@
module Propellor.Property.OS ( module Propellor.Property.OS (
cleanInstallOnce, cleanInstallOnce,
Confirmed(..), Confirmed(..),
fixupNetworkInterfaces, preserveNetworkInterfaces,
rootSshAuthorized, preserveRootSshAuthorized,
grubBoots, grubBoots,
GrubDev(..), GrubDev(..),
kernelInstalled, kernelInstalled,
@ -37,8 +37,8 @@ import Utility.FileMode
-- > & os (System (Debian Unstable) "amd64") -- > & os (System (Debian Unstable) "amd64")
-- > & cleanInstall (Confirmed "foo.example.com") [BackupOldOS, UseOldKernel] -- > & cleanInstall (Confirmed "foo.example.com") [BackupOldOS, UseOldKernel]
-- > `onChange` propertyList "fixing up after clean install" -- > `onChange` propertyList "fixing up after clean install"
-- > [ fixupNetworkInterfaces -- > [ preserveNetworkInterfaces
-- > , rootSshAuthorized -- > , preserverRootSshAuthorized
-- > -- , kernelInstalled -- > -- , kernelInstalled
-- > -- , grubBoots "hd0" -- > -- , grubBoots "hd0"
-- > ] -- > ]
@ -84,14 +84,14 @@ data Tweak
-- /etc/network/interfaces is configured to bring up all interfaces that -- /etc/network/interfaces is configured to bring up all interfaces that
-- are currently up, using the same IP addresses. -- are currently up, using the same IP addresses.
fixupNetworkInterfaces :: Property preserveNetworkInterfaces :: Property
fixupNetworkInterfaces = undefined preserveNetworkInterfaces = undefined
-- Root's .ssh/authorized_keys has added to it any ssh keys that -- Root's .ssh/authorized_keys has added to it any ssh keys that
-- were authorized in the old OS. Any other contents of the file are -- were authorized in the old OS. Any other contents of the file are
-- retained. -- retained.
rootSshAuthorized :: Property preserveRootSshAuthorized :: Property
rootSshAuthorized = check (doesDirectoryExist oldloc) $ preserveRootSshAuthorized = check (doesDirectoryExist oldloc) $
property (newloc ++ " copied from old OS") $ do property (newloc ++ " copied from old OS") $ do
ks <- liftIO $ lines <$> readFile oldloc ks <- liftIO $ lines <$> readFile oldloc
ensureProperties (map (Ssh.authorizedKey "root") ks) ensureProperties (map (Ssh.authorizedKey "root") ks)