diff options
| -rw-r--r-- | src/Propellor/Property/Apache.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Propellor/Property/Apache.hs b/src/Propellor/Property/Apache.hs index d912acc1..554a5837 100644 --- a/src/Propellor/Property/Apache.hs +++ b/src/Propellor/Property/Apache.hs @@ -64,6 +64,24 @@ modEnabled modname = enable <!> disable `onChange` reloaded isenabled = boolSystem "a2query" [Param "-q", Param "-m", Param modname] +-- | Control whether an apache configuration file is enabled. +-- +-- The String is the base name of the configuration, eg "charset" or "gitweb". +confEnabled :: String -> RevertableProperty DebianLike DebianLike +confEnabled confname = enable <!> disable + where + enable = check (not <$> isenabled) + (cmdProperty "a2enconf" ["--quiet", confname]) + `describe` ("apache configuration enabled " ++ confname) + `requires` installed + `onChange` reloaded + disable = check isenabled + (cmdProperty "a2disconf" ["--quiet", confname]) + `describe` ("apache configuration disabled " ++ confname) + `requires` installed + `onChange` reloaded + isenabled = boolSystem "a2query" [Param "-q", Param "-c", Param confname] + -- | Make apache listen on the specified ports. -- -- Note that ports are also specified inside a site's config file, |
