summaryrefslogtreecommitdiff
path: root/Propellor/Attr.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-13 15:34:01 -0400
committerJoey Hess2014-04-13 15:34:01 -0400
commit95ac5163da904780ae166c2bf3a0addcb8d8870e (patch)
treec476ec0951db984c2784a9e5ba7370bac333e64a /Propellor/Attr.hs
parent576acfed33abfae2065354431100701713e83a23 (diff)
Properties can now be satisfied differently on different operating systems.
Diffstat (limited to 'Propellor/Attr.hs')
-rw-r--r--Propellor/Attr.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Propellor/Attr.hs b/Propellor/Attr.hs
index 67ea8b8c..9a9d8446 100644
--- a/Propellor/Attr.hs
+++ b/Propellor/Attr.hs
@@ -21,6 +21,13 @@ hostname name = pureAttrProperty ("hostname " ++ name) $
getHostName :: Propellor HostName
getHostName = asks _hostname
+os :: System -> AttrProperty
+os system = pureAttrProperty ("OS " ++ show system) $
+ \d -> d { _os = Just system }
+
+getOS :: Propellor (Maybe System)
+getOS = asks _os
+
cname :: Domain -> AttrProperty
cname domain = pureAttrProperty ("cname " ++ domain) (addCName domain)