summaryrefslogtreecommitdiff
path: root/src/Propellor/PrivData.hs
diff options
context:
space:
mode:
authorJoey Hess2014-07-06 17:54:06 -0400
committerJoey Hess2014-07-06 17:54:06 -0400
commitcd37316dd5b512930bd9bce50617d4b16eee985a (patch)
treece7bd1bb970ae435b1fa16d99c30dff9bd7a4c7e /src/Propellor/PrivData.hs
parenteb39b45d618cacc48c8c25de1296802568aa0c26 (diff)
propigate required privdata fields out from docker containers to the hosts they're docked in
Diffstat (limited to 'src/Propellor/PrivData.hs')
-rw-r--r--src/Propellor/PrivData.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs
index e9e7e47f..d7d81a21 100644
--- a/src/Propellor/PrivData.hs
+++ b/src/Propellor/PrivData.hs
@@ -18,6 +18,7 @@ import qualified Data.Set as S
import Propellor.Types
import Propellor.Types.Info
import Propellor.Message
+import Propellor.Info
import Utility.Monad
import Utility.PartialPrelude
import Utility.Exception
@@ -62,6 +63,10 @@ withPrivData field context@(Context cname) mkprop = addinfo $ mkprop $ \a ->
return FailedChange
addinfo p = p { propertyInfo = propertyInfo p <> mempty { _privDataFields = S.singleton (field, context) } }
+addPrivDataField :: (PrivDataField, Context) -> Property
+addPrivDataField v = pureInfoProperty (show v) $
+ mempty { _privDataFields = S.singleton v }
+
{- Gets the requested field's value, in the specified context if it's
- available, from the host's local privdata cache. -}
getLocalPrivData :: PrivDataField -> Context -> IO (Maybe PrivData)