Fix Apache.siteEnabled to update the config file and reload apache when configuration has changed.

This commit is contained in:
Joey Hess 2014-12-09 00:34:24 -04:00
parent f8943c2036
commit b22201e36b
3 changed files with 23 additions and 4 deletions

View File

@ -76,6 +76,20 @@ darkstar = host "darkstar.kitenet.net"
& Apt.buildDep ["git-annex"] `period` Daily
& Docker.configured
! 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 = standardSystem "clam.kitenet.net" Unstable "amd64"

2
debian/changelog vendored
View File

@ -5,6 +5,8 @@ propellor (1.2.0) unstable; urgency=medium
* Removed boolProperty; instead the new toResult can be used. (API change)
* Include Propellor.Property.OS, which was accidentially left out of the
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

View File

@ -11,12 +11,15 @@ type ConfigFile = [String]
siteEnabled :: HostName -> ConfigFile -> RevertableProperty
siteEnabled hn cf = RevertableProperty enable disable
where
enable = check (not <$> isenabled) $
cmdProperty "a2ensite" ["--quiet", hn]
`describe` ("apache site enabled " ++ hn)
`requires` siteAvailable hn cf
enable = combineProperties ("apache site enabled " ++ hn)
[ siteAvailable hn cf
`requires` installed
`onChange` reloaded
, check (not <$> isenabled) $
cmdProperty "a2ensite" ["--quiet", hn]
`requires` installed
`onChange` reloaded
]
disable = combineProperties
("apache site disabled " ++ hn)
(map File.notPresent (siteCfg hn))