summaryrefslogtreecommitdiff
path: root/src/Propellor/Info.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Info.hs')
-rw-r--r--src/Propellor/Info.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Propellor/Info.hs b/src/Propellor/Info.hs
index ba73b449..01a53ad5 100644
--- a/src/Propellor/Info.hs
+++ b/src/Propellor/Info.hs
@@ -11,6 +11,7 @@ module Propellor.Info (
pureInfoProperty',
askInfo,
getOS,
+ hasContainerCapability,
ipv4,
ipv6,
alias,
@@ -26,6 +27,7 @@ module Propellor.Info (
import Propellor.Types
import Propellor.Types.Info
import Propellor.Types.MetaTypes
+import Propellor.Types.Container
import "mtl" Control.Monad.Reader
import qualified Data.Set as S
@@ -75,6 +77,11 @@ pureInfoProperty' desc i = setInfoProperty p i
askInfo :: (IsInfo v) => Propellor v
askInfo = asks (fromInfo . hostInfo)
+-- | Checks if a ContainerCapability is set in the current Info.
+hasContainerCapability :: ContainerCapability -> Propellor Bool
+hasContainerCapability c = elem c
+ <$> (askInfo :: Propellor [ContainerCapability])
+
-- | Specifies that a host's operating system is Debian,
-- and further indicates the suite and architecture.
--