From 8d1814a8847f0e498be39a31863e9dd6ffe7e4aa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 24 Nov 2014 00:51:36 -0400 Subject: move property to ssh module --- src/Propellor/Property/OS.hs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/Propellor/Property/OS.hs') diff --git a/src/Propellor/Property/OS.hs b/src/Propellor/Property/OS.hs index ed9a31e1..3290f3ba 100644 --- a/src/Propellor/Property/OS.hs +++ b/src/Propellor/Property/OS.hs @@ -13,10 +13,9 @@ import Propellor import qualified Propellor.Property.Chroot as Chroot import qualified Propellor.Property.Debootstrap as Debootstrap import qualified Propellor.Property.File as File +import qualified Propellor.Property.Ssh as Ssh import Utility.FileMode -import Utility.PosixFiles - -- | Replaces whatever OS was installed before with a clean installation -- of the OS that the Host is configured to have. -- @@ -95,15 +94,10 @@ rootSshAuthorized :: Property rootSshAuthorized = check (doesDirectoryExist oldloc) $ property (newloc ++ " copied from old OS") $ do ks <- liftIO $ lines <$> readFile oldloc - ensureProperty $ - newloc `File.containsLines` ks - `requires` File.dirExists (takeDirectory newloc) - `onChange` File.mode newloc mode + ensureProperties (map (Ssh.authorizedKey "root") ks) where newloc = "/root/.ssh/authorized_keys" oldloc = oldOsDir ++ newloc - -- ssh requires the file mode be locked down - mode = combineModes [ownerWriteMode, ownerReadMode] -- Installs an appropriate kernel from the OS distribution. kernelInstalled :: Property -- cgit v1.2.3