summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton2016-06-19 20:27:15 +0900
committerSean Whitton2016-06-19 20:27:15 +0900
commitcb6503bfa32365b96a6b676eb4d0074df2601554 (patch)
tree3e33dca53a58845b82c2ae5778dac0d516258257
parent19c3774b801ea3c33b6dde61dbea9072bbf03129 (diff)
Joey's Schroot.useOverlays info property
-rw-r--r--src/Propellor/Property/Schroot.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Propellor/Property/Schroot.hs b/src/Propellor/Property/Schroot.hs
index c53ce4f1..0e683562 100644
--- a/src/Propellor/Property/Schroot.hs
+++ b/src/Propellor/Property/Schroot.hs
@@ -3,11 +3,27 @@
module Propellor.Property.Schroot where
import Propellor.Base
+import Propellor.Types.Info
import qualified Propellor.Property.File as File
import qualified Propellor.Property.Apt as Apt
import Utility.FileMode
+data UseOverlays = UseOverlays deriving (Eq, Show)
+
+-- | Indicate that a schroots on a host should use @union-type=overlay@
+--
+-- Setting this property does not actually ensure that the line
+-- @union-type=overlay@ is present in any schroot config files. See
+-- 'Propellor.Property.Sbuild.built' for example usage.
+useOverlays :: Property (HasInfo + UnixLike)
+useOverlays = pureInfoProperty "use schroot overlays" (InfoVal UseOverlays)
+
+-- | Gets whether a host uses overlays.
+usesOverlays :: Propellor Bool
+usesOverlays = isJust . fromInfoVal
+ <$> (askInfo :: Propellor (InfoVal UseOverlays))
+
-- | Configure schroot such that all schroots with @union-type=overlay@ in their
-- configuration will run their overlays in a tmpfs.
--