Merge branch 'joeyconfig'
This commit is contained in:
commit
4f309c5cd6
|
@ -76,6 +76,20 @@ darkstar = host "darkstar.kitenet.net"
|
||||||
& Apt.buildDep ["git-annex"] `period` Daily
|
& Apt.buildDep ["git-annex"] `period` Daily
|
||||||
& Docker.configured
|
& Docker.configured
|
||||||
! Docker.docked gitAnnexAndroidDev
|
! Docker.docked gitAnnexAndroidDev
|
||||||
|
& website "foo"
|
||||||
|
|
||||||
|
website :: String -> RevertableProperty
|
||||||
|
website hn = Apache.siteEnabled hn apachecfg
|
||||||
|
where
|
||||||
|
apachecfg = [ "<VirtualHost *>"
|
||||||
|
, "DocumentRoot /tmp/xx"
|
||||||
|
, "<Directory /tmp/xx>"
|
||||||
|
, " Options Indexes FollowSymLinks Multiviews"
|
||||||
|
, " Order allow,deny"
|
||||||
|
, Apache.allowAll
|
||||||
|
, "</Directory>"
|
||||||
|
, "</VirtualHost>"
|
||||||
|
]
|
||||||
|
|
||||||
clam :: Host
|
clam :: Host
|
||||||
clam = standardSystem "clam.kitenet.net" Unstable "amd64"
|
clam = standardSystem "clam.kitenet.net" Unstable "amd64"
|
||||||
|
|
|
@ -5,6 +5,8 @@ propellor (1.2.0) unstable; urgency=medium
|
||||||
* Removed boolProperty; instead the new toResult can be used. (API change)
|
* Removed boolProperty; instead the new toResult can be used. (API change)
|
||||||
* Include Propellor.Property.OS, which was accidentially left out of the
|
* Include Propellor.Property.OS, which was accidentially left out of the
|
||||||
cabal file in the last release.
|
cabal file in the last release.
|
||||||
|
* Fix Apache.siteEnabled to update the config file and reload apache when
|
||||||
|
configuration has changed.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Tue, 09 Dec 2014 00:05:09 -0400
|
-- Joey Hess <id@joeyh.name> Tue, 09 Dec 2014 00:05:09 -0400
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,15 @@ type ConfigFile = [String]
|
||||||
siteEnabled :: HostName -> ConfigFile -> RevertableProperty
|
siteEnabled :: HostName -> ConfigFile -> RevertableProperty
|
||||||
siteEnabled hn cf = RevertableProperty enable disable
|
siteEnabled hn cf = RevertableProperty enable disable
|
||||||
where
|
where
|
||||||
enable = check (not <$> isenabled) $
|
enable = combineProperties ("apache site enabled " ++ hn)
|
||||||
cmdProperty "a2ensite" ["--quiet", hn]
|
[ siteAvailable hn cf
|
||||||
`describe` ("apache site enabled " ++ hn)
|
|
||||||
`requires` siteAvailable hn cf
|
|
||||||
`requires` installed
|
`requires` installed
|
||||||
`onChange` reloaded
|
`onChange` reloaded
|
||||||
|
, check (not <$> isenabled) $
|
||||||
|
cmdProperty "a2ensite" ["--quiet", hn]
|
||||||
|
`requires` installed
|
||||||
|
`onChange` reloaded
|
||||||
|
]
|
||||||
disable = combineProperties
|
disable = combineProperties
|
||||||
("apache site disabled " ++ hn)
|
("apache site disabled " ++ hn)
|
||||||
(map File.notPresent (siteCfg hn))
|
(map File.notPresent (siteCfg hn))
|
||||||
|
|
|
@ -62,11 +62,11 @@ fileProperty' :: (FilePath -> String -> IO ()) -> Desc -> ([Line] -> [Line]) ->
|
||||||
fileProperty' writer desc a f = property desc $ go =<< liftIO (doesFileExist f)
|
fileProperty' writer desc a f = property desc $ go =<< liftIO (doesFileExist f)
|
||||||
where
|
where
|
||||||
go True = do
|
go True = do
|
||||||
ls <- liftIO $ lines <$> readFile f
|
old <- liftIO $ readFile f
|
||||||
let ls' = a ls
|
let new = unlines (a (lines old))
|
||||||
if ls' == ls
|
if old == new
|
||||||
then noChange
|
then noChange
|
||||||
else makeChange $ viaTmp updatefile f (unlines ls')
|
else makeChange $ viaTmp updatefile f new
|
||||||
go False = makeChange $ writer f (unlines $ a [])
|
go False = makeChange $ writer f (unlines $ a [])
|
||||||
|
|
||||||
-- viaTmp makes the temp file mode 600.
|
-- viaTmp makes the temp file mode 600.
|
||||||
|
|
Loading…
Reference in New Issue