diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-16 15:36:24 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-16 15:36:24 -0400 |
| commit | 06f4258f8174302a825a893b3407df9cff15c577 (patch) | |
| tree | 9673a75b78716852425e417a1d8519de2d8b20ca /src/Propellor/Property/Nginx.hs | |
| parent | f3a4b1a1beab90e2c630465811ce4a198ad7ba0f (diff) | |
| parent | 7f7249f801653e0bd7fa083ed001bf3c5a3c3900 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/Nginx.hs')
| -rw-r--r-- | src/Propellor/Property/Nginx.hs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/Propellor/Property/Nginx.hs b/src/Propellor/Property/Nginx.hs index d0d4d3a9..c9b4d8fd 100644 --- a/src/Propellor/Property/Nginx.hs +++ b/src/Propellor/Property/Nginx.hs @@ -6,24 +6,17 @@ import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service -import System.Posix.Files type ConfigFile = [String] siteEnabled :: HostName -> ConfigFile -> RevertableProperty siteEnabled hn cf = enable <!> disable where - enable = check test prop + enable = siteVal hn `File.isSymlinkedTo` siteValRelativeCfg hn `describe` ("nginx site enabled " ++ hn) `requires` siteAvailable hn cf `requires` installed `onChange` reloaded - where - test = not <$> doesFileExist (siteVal hn) - prop = property "nginx site in place" $ makeChange $ - createSymbolicLink target dir - target = siteValRelativeCfg hn - dir = siteVal hn disable = trivial $ File.notPresent (siteVal hn) `describe` ("nginx site disable" ++ hn) `requires` installed @@ -41,8 +34,8 @@ siteCfg hn = "/etc/nginx/sites-available/" ++ hn siteVal :: HostName -> FilePath siteVal hn = "/etc/nginx/sites-enabled/" ++ hn -siteValRelativeCfg :: HostName -> FilePath -siteValRelativeCfg hn = "../sites-available/" ++ hn +siteValRelativeCfg :: HostName -> File.LinkTarget +siteValRelativeCfg hn = File.LinkTarget ("../sites-available/" ++ hn) installed :: Property NoInfo installed = Apt.installed ["nginx"] |
