summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2015-09-02 14:03:11 -0700
committerJoey Hess2015-09-02 14:03:11 -0700
commitef0fe77e7123949ed5a1ebe922bde93044bd9e38 (patch)
tree9b1d7549b9548d6dc58745c7315a8b91f9f5c30e
parent2a645cc290faa82e3f763f3ced0ebaa68226351e (diff)
docs
-rw-r--r--src/Propellor/Info.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Propellor/Info.hs b/src/Propellor/Info.hs
index f1f23b96..0eea0816 100644
--- a/src/Propellor/Info.hs
+++ b/src/Propellor/Info.hs
@@ -18,10 +18,15 @@ pureInfoProperty desc i = infoProperty ("has " ++ desc) (return NoChange) i memp
askInfo :: (Info -> Val a) -> Propellor (Maybe a)
askInfo f = asks (fromVal . f . hostInfo)
+-- | Specifies the operating system of a host.
+--
+-- This only provides info for other Properties, so they can act
+-- conditional on the os.
os :: System -> Property HasInfo
os system = pureInfoProperty ("Operating " ++ show system) $
mempty { _os = Val system }
+-- Gets the operating system of a host, if it has been specified.
getOS :: Propellor (Maybe System)
getOS = askInfo _os