summaryrefslogtreecommitdiff
path: root/Propellor/Property/SiteSpecific
diff options
context:
space:
mode:
authorJoey Hess2014-04-10 17:22:32 -0400
committerJoey Hess2014-04-10 17:23:43 -0400
commit25942fb0cca0ca90933026bf959506e099ff95a4 (patch)
tree2f84378c71abaa4458c5078e8cb8e6726bffbefd /Propellor/Property/SiteSpecific
parent5acaf8758f752574140dd79de7996d91a81d1cd4 (diff)
Propellor monad is a Reader for HostAttr
So far, the hostname is only used to improve a message in withPrivData, but I anticipate using HostAttr for a lot more.
Diffstat (limited to 'Propellor/Property/SiteSpecific')
-rw-r--r--Propellor/Property/SiteSpecific/GitAnnexBuilder.hs5
-rw-r--r--Propellor/Property/SiteSpecific/GitHome.hs2
2 files changed, 4 insertions, 3 deletions
diff --git a/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
index 580a52dc..204a9ca7 100644
--- a/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
+++ b/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
@@ -44,12 +44,13 @@ builder arch crontimes rsyncupload = combineProperties "gitannexbuilder"
let f = homedir </> "rsyncpassword"
if rsyncupload
then withPrivData (Password builduser) $ \p -> do
- oldp <- catchDefaultIO "" $ readFileStrict f
+ oldp <- liftIO $ catchDefaultIO "" $
+ readFileStrict f
if p /= oldp
then makeChange $ writeFile f p
else noChange
else do
- ifM (doesFileExist f)
+ ifM (liftIO $ doesFileExist f)
( noChange
, makeChange $ writeFile f "no password configured"
)
diff --git a/Propellor/Property/SiteSpecific/GitHome.hs b/Propellor/Property/SiteSpecific/GitHome.hs
index 482100ca..1ba56b94 100644
--- a/Propellor/Property/SiteSpecific/GitHome.hs
+++ b/Propellor/Property/SiteSpecific/GitHome.hs
@@ -8,7 +8,7 @@ import Utility.SafeCommand
-- | Clones Joey Hess's git home directory, and runs its fixups script.
installedFor :: UserName -> Property
installedFor user = check (not <$> hasGitDir user) $
- Property ("githome " ++ user) (go =<< homedir user)
+ Property ("githome " ++ user) (go =<< liftIO (homedir user))
`requires` Apt.installed ["git"]
where
go Nothing = noChange