Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- interpretCatalog :: Monad m => InterpreterReader m -> NodeName -> Facts -> Container Text -> m (Pair (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource])) [Pair Priority Doc])
- computeCatalog :: NodeName -> InterpreterMonad (FinalCatalog, EdgeMap, FinalCatalog, [Resource])
- evaluateStatement :: Statement -> InterpreterMonad [Resource]
- initialState :: Facts -> Container Text -> InterpreterState
- extractScope :: InterpreterState -> Maybe (Text, Container ScopeInformation)
- containerModName :: CurContainerDesc -> Text
- askFact :: Text -> InterpreterMonad (Maybe PValue)
- data InterpreterState = InterpreterState !(Container ScopeInformation) !(Container (Pair ClassIncludeType PPosition)) !(HashMap RIdentifier Resource) ![CurContainerDesc] !PPosition !(HashMap (TopLevelType, Text) Statement) ![LinkInformation] ![ResourceModifier]
- scopes :: Lens' InterpreterState (Container ScopeInformation)
- definedResources :: Lens' InterpreterState (HashMap RIdentifier Resource)
- nestedDeclarations :: Lens' InterpreterState (HashMap (TopLevelType, Text) Statement)
- resModifiers :: Lens' InterpreterState [ResourceModifier]
- extraRelations :: Lens' InterpreterState [LinkInformation]
- curScope :: Lens' InterpreterState [CurContainerDesc]
- curPos :: Lens' InterpreterState PPosition
- loadedClasses :: Lens' InterpreterState (Container (Pair ClassIncludeType PPosition))
- data InterpreterReader m = InterpreterReader !(Container NativeTypeMethods) (TopLevelType -> Text -> m (Either PrettyError Statement)) (TemplateSource -> InterpreterState -> InterpreterReader m -> m (Either PrettyError Text)) (PuppetDBAPI m) (Container ([PValue] -> InterpreterMonad PValue)) Text (HieraQueryLayers m) (IoMethods m) (HashSet Text) (HashSet Text) Bool PuppetDirPaths (Maybe FilePath) (Container PValue)
- readerNativeTypes :: forall m. Lens' (InterpreterReader m) (Container NativeTypeMethods)
- readerGetStatement :: forall m. Lens' (InterpreterReader m) (TopLevelType -> Text -> m (Either PrettyError Statement))
- readerGetTemplate :: forall m. Lens' (InterpreterReader m) (TemplateSource -> InterpreterState -> InterpreterReader m -> m (Either PrettyError Text))
- readerPdbApi :: forall m. Lens' (InterpreterReader m) (PuppetDBAPI m)
- readerExternalFunc :: forall m. Lens' (InterpreterReader m) (Container ([PValue] -> InterpreterMonad PValue))
- readerNodename :: forall m. Lens' (InterpreterReader m) Text
- readerHieraQuery :: forall m. Lens' (InterpreterReader m) (HieraQueryLayers m)
- readerIoMethods :: forall m. Lens' (InterpreterReader m) (IoMethods m)
- readerIgnoredModules :: forall m. Lens' (InterpreterReader m) (HashSet Text)
- readerExternalModules :: forall m. Lens' (InterpreterReader m) (HashSet Text)
- readerIsStrict :: forall m. Lens' (InterpreterReader m) Bool
- readerPuppetPaths :: forall m. Lens' (InterpreterReader m) PuppetDirPaths
- readerFacts :: forall m. Lens' (InterpreterReader m) (Container PValue)
- readerRebaseFile :: forall m. Lens' (InterpreterReader m) (Maybe FilePath)
- type InterpreterMonad = ProgramT InterpreterInstr (State InterpreterState)
- type InterpreterWriter = [Pair Priority Doc]
- data InterpreterInstr a where
- GetNativeTypes :: InterpreterInstr (Container NativeTypeMethods)
- GetStatement :: TopLevelType -> Text -> InterpreterInstr Statement
- ComputeTemplate :: TemplateSource -> InterpreterState -> InterpreterInstr Text
- ExternalFunction :: Text -> [PValue] -> InterpreterInstr PValue
- Facts :: InterpreterInstr (Container PValue)
- GetNodeName :: InterpreterInstr Text
- HieraQuery :: Container PValue -> Text -> HieraQueryType -> InterpreterInstr (Maybe PValue)
- GetCurrentCallStack :: InterpreterInstr [String]
- IsIgnoredModule :: Text -> InterpreterInstr Bool
- IsExternalModule :: Text -> InterpreterInstr Bool
- IsStrict :: InterpreterInstr Bool
- PuppetPaths :: InterpreterInstr PuppetDirPaths
- RebaseFile :: InterpreterInstr (Maybe FilePath)
- ErrorThrow :: PrettyError -> InterpreterInstr a
- ErrorCatch :: InterpreterMonad a -> (PrettyError -> InterpreterMonad a) -> InterpreterInstr a
- WriterTell :: InterpreterWriter -> InterpreterInstr ()
- WriterPass :: InterpreterMonad (a, InterpreterWriter -> InterpreterWriter) -> InterpreterInstr a
- WriterListen :: InterpreterMonad a -> InterpreterInstr (a, InterpreterWriter)
- PDBInformation :: InterpreterInstr Doc
- PDBReplaceCatalog :: WireCatalog -> InterpreterInstr ()
- PDBReplaceFacts :: [(NodeName, Facts)] -> InterpreterInstr ()
- PDBDeactivateNode :: NodeName -> InterpreterInstr ()
- PDBGetFacts :: Query FactField -> InterpreterInstr [FactInfo]
- PDBGetResources :: Query ResourceField -> InterpreterInstr [Resource]
- PDBGetNodes :: Query NodeField -> InterpreterInstr [NodeInfo]
- PDBCommitDB :: InterpreterInstr ()
- PDBGetResourcesOfNode :: NodeName -> Query ResourceField -> InterpreterInstr [Resource]
- ReadFile :: [Text] -> InterpreterInstr Text
- TraceEvent :: String -> InterpreterInstr ()
- data Strictness
- = Strict
- | Permissive
- data IoMethods m = IoMethods (m [String]) ([Text] -> m (Either String Text)) (String -> m ())
- ioGetCurrentCallStack :: forall m. Lens' (IoMethods m) (m [String])
- ioReadFile :: forall m. Lens' (IoMethods m) ([Text] -> m (Either String Text))
- ioTraceEvent :: forall m. Lens' (IoMethods m) (String -> m ())
- class Monad m => MonadThrowPos m where
- throwPosError :: Doc -> m a
- data ResourceModifier = ResourceModifier !Text !ModifierType !ResourceCollectorType !RSearchExpression !(Resource -> InterpreterMonad Resource) !PPosition
- rmResType :: Lens' ResourceModifier Text
- rmDeclaration :: Lens' ResourceModifier PPosition
- rmSearch :: Lens' ResourceModifier RSearchExpression
- rmType :: Lens' ResourceModifier ResourceCollectorType
- rmMutation :: Lens' ResourceModifier (Resource -> InterpreterMonad Resource)
- rmModifierType :: Lens' ResourceModifier ModifierType
- data ModifierType
- data OverrideType
- data ResourceCollectorType
- data ClassIncludeType
- data RSearchExpression
- data ScopeInformation = ScopeInformation !(Container (Pair (Pair PValue PPosition) CurContainerDesc)) !(Container ResDefaults) !(HashSet Text) !CurContainer !(HashMap RIdentifier ResRefOverride) !(Maybe Text)
- scopeResDefaults :: Lens' ScopeInformation (Container ResDefaults)
- scopeVariables :: Lens' ScopeInformation (Container (Pair (Pair PValue PPosition) CurContainerDesc))
- scopeParent :: Lens' ScopeInformation (Maybe Text)
- scopeOverrides :: Lens' ScopeInformation (HashMap RIdentifier ResRefOverride)
- scopeContainer :: Lens' ScopeInformation CurContainer
- scopeExtraTags :: Lens' ScopeInformation (HashSet Text)
- data CurContainer = CurContainer !CurContainerDesc !(HashSet Text)
- cctype :: Lens' CurContainer CurContainerDesc
- cctags :: Lens' CurContainer (HashSet Text)
- data ResDefaults = ResDefaults !Text !Text !(Container PValue) !PPosition
- resDefValues :: Lens' ResDefaults (Container PValue)
- resDefSrcScope :: Lens' ResDefaults Text
- resDefPos :: Lens' ResDefaults PPosition
- resDefType :: Lens' ResDefaults Text
- data ResRefOverride = ResRefOverride {}
- data ScopeEnteringContext
- data TopLevelType
- data HieraQueryLayers m = HieraQueryLayers {}
- globalLayer :: forall m. Lens' (HieraQueryLayers m) (HieraQueryFunc m)
- environmentLayer :: forall m. Lens' (HieraQueryLayers m) (HieraQueryFunc m)
- moduleLayer :: forall m. Lens' (HieraQueryLayers m) (Container (HieraQueryFunc m))
- data TemplateSource
- module Puppet.Language
- getVariable :: Container ScopeInformation -> Text -> Text -> Either Doc PValue
- pValue2Bool :: PValue -> Bool
- resolveVariable :: Text -> InterpreterMonad PValue
- resolveExpression :: Expression -> InterpreterMonad PValue
- resolveValue :: UnresolvedValue -> InterpreterMonad PValue
- resolvePValueString :: PValue -> InterpreterMonad Text
- resolvePValueNumber :: PValue -> InterpreterMonad Scientific
- resolveExpressionString :: Expression -> InterpreterMonad Text
- resolveExpressionStrings :: Expression -> InterpreterMonad [Text]
- resolveFunction' :: Text -> [PValue] -> InterpreterMonad PValue
- resolveDataType :: UDataType -> InterpreterMonad DataType
- runHiera :: Text -> HieraQueryType -> InterpreterMonad (Maybe PValue)
- isNativeType :: Text -> InterpreterMonad Bool
- resolveSearchExpression :: SearchExpression -> InterpreterMonad RSearchExpression
- checkSearchExpression :: RSearchExpression -> Resource -> Bool
- searchExpressionToPuppetDB :: Text -> RSearchExpression -> Query ResourceField
- hfGenerateAssociations :: HOLambdaCall -> InterpreterMonad [[(Text, PValue)]]
- hfSetvars :: [(Text, PValue)] -> InterpreterMonad (Container (Pair (Pair PValue PPosition) CurContainerDesc))
- hfRestorevars :: Container (Pair (Pair PValue PPosition) CurContainerDesc) -> InterpreterMonad ()
- fixResourceName :: Text -> Text -> Text
- datatypeMatch :: DataType -> PValue -> Bool
- checkMatch :: DataType -> PValue -> InterpreterMonad ()
- typeOf :: PValue -> DataType
- interpretMonad :: Monad m => InterpreterReader m -> InterpreterState -> InterpreterMonad a -> m (Either PrettyError a, InterpreterState, InterpreterWriter)
Documentation
:: Monad m | |
=> InterpreterReader m | The whole environment required for computing catalog. |
-> NodeName | |
-> Facts | |
-> Container Text | Server settings |
-> m (Pair (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource])) [Pair Priority Doc]) |
Call the operational interpretMonad
function to compute the catalog.
Returns either an error, or a tuple containing all the resources,
dependency map, exported resources, and defined resources alongside with
all messages that have been generated by the compilation process.
The later defined resources (eg. all class declarations) are pulled out of the
InterpreterState
and might not be up to date.
There are only useful for coverage testing (checking dependencies for instance).
computeCatalog :: NodeName -> InterpreterMonad (FinalCatalog, EdgeMap, FinalCatalog, [Resource]) Source #
Main internal entry point, this function completes the interpretation
Utils
:: Facts | |
-> Container Text | Server settings |
-> InterpreterState |
askFact :: Text -> InterpreterMonad (Maybe PValue) Source #
Ask the value of a fact given a specified key The fact set comes from the reader used by the interpreter monad.
Operational state
data InterpreterState Source #
Instances
MonadFail InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types fail :: String -> InterpreterMonad a # | |
MonadThrowPos InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types throwPosError :: Doc -> InterpreterMonad a Source # | |
MonadError PrettyError InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types throwError :: PrettyError -> InterpreterMonad a # catchError :: InterpreterMonad a -> (PrettyError -> InterpreterMonad a) -> InterpreterMonad a # | |
MonadWriter InterpreterWriter InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types writer :: (a, InterpreterWriter) -> InterpreterMonad a # tell :: InterpreterWriter -> InterpreterMonad () # listen :: InterpreterMonad a -> InterpreterMonad (a, InterpreterWriter) # pass :: InterpreterMonad (a, InterpreterWriter -> InterpreterWriter) -> InterpreterMonad a # |
Operational reader
data InterpreterReader m Source #
InterpreterReader !(Container NativeTypeMethods) (TopLevelType -> Text -> m (Either PrettyError Statement)) (TemplateSource -> InterpreterState -> InterpreterReader m -> m (Either PrettyError Text)) (PuppetDBAPI m) (Container ([PValue] -> InterpreterMonad PValue)) Text (HieraQueryLayers m) (IoMethods m) (HashSet Text) (HashSet Text) Bool PuppetDirPaths (Maybe FilePath) (Container PValue) |
readerNativeTypes :: forall m. Lens' (InterpreterReader m) (Container NativeTypeMethods) Source #
readerGetStatement :: forall m. Lens' (InterpreterReader m) (TopLevelType -> Text -> m (Either PrettyError Statement)) Source #
readerGetTemplate :: forall m. Lens' (InterpreterReader m) (TemplateSource -> InterpreterState -> InterpreterReader m -> m (Either PrettyError Text)) Source #
readerPdbApi :: forall m. Lens' (InterpreterReader m) (PuppetDBAPI m) Source #
readerExternalFunc :: forall m. Lens' (InterpreterReader m) (Container ([PValue] -> InterpreterMonad PValue)) Source #
readerNodename :: forall m. Lens' (InterpreterReader m) Text Source #
readerHieraQuery :: forall m. Lens' (InterpreterReader m) (HieraQueryLayers m) Source #
readerIoMethods :: forall m. Lens' (InterpreterReader m) (IoMethods m) Source #
readerIgnoredModules :: forall m. Lens' (InterpreterReader m) (HashSet Text) Source #
readerExternalModules :: forall m. Lens' (InterpreterReader m) (HashSet Text) Source #
readerIsStrict :: forall m. Lens' (InterpreterReader m) Bool Source #
readerPuppetPaths :: forall m. Lens' (InterpreterReader m) PuppetDirPaths Source #
readerFacts :: forall m. Lens' (InterpreterReader m) (Container PValue) Source #
readerRebaseFile :: forall m. Lens' (InterpreterReader m) (Maybe FilePath) Source #
Interpreter monad
type InterpreterMonad = ProgramT InterpreterInstr (State InterpreterState) Source #
The main monad
data InterpreterInstr a where Source #
Instances
MonadFail InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types fail :: String -> InterpreterMonad a # | |
MonadThrowPos InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types throwPosError :: Doc -> InterpreterMonad a Source # | |
MonadError PrettyError InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types throwError :: PrettyError -> InterpreterMonad a # catchError :: InterpreterMonad a -> (PrettyError -> InterpreterMonad a) -> InterpreterMonad a # | |
MonadWriter InterpreterWriter InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types writer :: (a, InterpreterWriter) -> InterpreterMonad a # tell :: InterpreterWriter -> InterpreterMonad () # listen :: InterpreterMonad a -> InterpreterMonad (a, InterpreterWriter) # pass :: InterpreterMonad (a, InterpreterWriter -> InterpreterWriter) -> InterpreterMonad a # | |
Pretty (InterpreterInstr a) Source # | |
Defined in Puppet.Interpreter.PrettyPrinter pretty :: InterpreterInstr a -> Doc # prettyList :: [InterpreterInstr a] -> Doc # |
data Strictness Source #
The intepreter can run in two modes : a strict mode (recommended), and a permissive mode.
Instances
Eq Strictness Source # | |
Defined in Puppet.Interpreter.Types (==) :: Strictness -> Strictness -> Bool # (/=) :: Strictness -> Strictness -> Bool # | |
Show Strictness Source # | |
Defined in Puppet.Interpreter.Types showsPrec :: Int -> Strictness -> ShowS # show :: Strictness -> String # showList :: [Strictness] -> ShowS # | |
FromJSON Strictness Source # | |
Defined in Puppet.Interpreter.Types parseJSON :: Value -> Parser Strictness # parseJSONList :: Value -> Parser [Strictness] # |
Io methods
class Monad m => MonadThrowPos m where Source #
throwPosError :: Doc -> m a Source #
Instances
MonadThrowPos InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types throwPosError :: Doc -> InterpreterMonad a Source # | |
MonadThrowPos (Either Doc) Source # | |
Defined in Puppet.Interpreter.Types |
Resource modifier
data ResourceModifier Source #
ResourceModifier !Text !ModifierType !ResourceCollectorType !RSearchExpression !(Resource -> InterpreterMonad Resource) !PPosition |
Instances
Show ResourceModifier Source # | |
Defined in Puppet.Interpreter.Types showsPrec :: Int -> ResourceModifier -> ShowS # show :: ResourceModifier -> String # showList :: [ResourceModifier] -> ShowS # | |
Pretty ResourceModifier Source # | |
Defined in Puppet.Interpreter.PrettyPrinter pretty :: ResourceModifier -> Doc # prettyList :: [ResourceModifier] -> Doc # |
data ModifierType Source #
ModifierCollector | For collectors, optional resources |
ModifierMustMatch | For stuff like realize |
Instances
Eq ModifierType Source # | |
Defined in Puppet.Interpreter.Types (==) :: ModifierType -> ModifierType -> Bool # (/=) :: ModifierType -> ModifierType -> Bool # | |
Show ModifierType Source # | |
Defined in Puppet.Interpreter.Types showsPrec :: Int -> ModifierType -> ShowS # show :: ModifierType -> String # showList :: [ModifierType] -> ShowS # |
data OverrideType Source #
CantOverride | Overriding forbidden, will throw an error |
Replace | Can silently replace |
CantReplace | Silently ignore errors |
AppendAttribute | Can append values |
Instances
Eq OverrideType Source # | |
Defined in Puppet.Interpreter.Types (==) :: OverrideType -> OverrideType -> Bool # (/=) :: OverrideType -> OverrideType -> Bool # | |
Show OverrideType Source # | |
Defined in Puppet.Interpreter.Types showsPrec :: Int -> OverrideType -> ShowS # show :: OverrideType -> String # showList :: [OverrideType] -> ShowS # |
data ResourceCollectorType Source #
Instances
Eq ResourceCollectorType Source # | |
Defined in Puppet.Interpreter.Types (==) :: ResourceCollectorType -> ResourceCollectorType -> Bool # (/=) :: ResourceCollectorType -> ResourceCollectorType -> Bool # | |
Show ResourceCollectorType Source # | |
Defined in Puppet.Interpreter.Types showsPrec :: Int -> ResourceCollectorType -> ShowS # show :: ResourceCollectorType -> String # showList :: [ResourceCollectorType] -> ShowS # |
data ClassIncludeType Source #
Puppet has two main ways to declare classes: include-like and resource-like.
See puppet reference.
ClassIncludeLike | Using the include or contain function |
ClassResourceLike | Resource like declaration |
Instances
Eq ClassIncludeType Source # | |
Defined in Puppet.Interpreter.Types (==) :: ClassIncludeType -> ClassIncludeType -> Bool # (/=) :: ClassIncludeType -> ClassIncludeType -> Bool # |
data RSearchExpression Source #
REqualitySearch !Text !PValue | |
RNonEqualitySearch !Text !PValue | |
RAndSearch !RSearchExpression !RSearchExpression | |
ROrSearch !RSearchExpression !RSearchExpression | |
RAlwaysTrue |
Instances
Eq RSearchExpression Source # | |
Defined in Puppet.Interpreter.Types (==) :: RSearchExpression -> RSearchExpression -> Bool # (/=) :: RSearchExpression -> RSearchExpression -> Bool # | |
Show RSearchExpression Source # | |
Defined in Puppet.Interpreter.Types showsPrec :: Int -> RSearchExpression -> ShowS # show :: RSearchExpression -> String # showList :: [RSearchExpression] -> ShowS # | |
Pretty RSearchExpression Source # | |
Defined in Puppet.Interpreter.PrettyPrinter pretty :: RSearchExpression -> Doc # prettyList :: [RSearchExpression] -> Doc # |
Scope information
data ScopeInformation Source #
scopeVariables :: Lens' ScopeInformation (Container (Pair (Pair PValue PPosition) CurContainerDesc)) Source #
data CurContainer Source #
The type of the container together with its tags.
Instances
Eq CurContainer Source # | |
Defined in Puppet.Interpreter.Types (==) :: CurContainer -> CurContainer -> Bool # (/=) :: CurContainer -> CurContainer -> Bool # |
Resource default
data ResDefaults Source #
From the evaluation of Resource Default Declaration.
Instances
Pretty ResDefaults Source # | |
Defined in Puppet.Interpreter.PrettyPrinter pretty :: ResDefaults -> Doc # prettyList :: [ResDefaults] -> Doc # |
data ResRefOverride Source #
From the evaluation of Resource Override Declaration.
Instances
Eq ResRefOverride Source # | |
Defined in Puppet.Interpreter.Types (==) :: ResRefOverride -> ResRefOverride -> Bool # (/=) :: ResRefOverride -> ResRefOverride -> Bool # |
data ScopeEnteringContext Source #
data TopLevelType Source #
Differentiate the distinct top level types such as node, define or class.
Instances
Hiera
data HieraQueryLayers m Source #
All available queries including the global and module layer The environment layer is not implemented.
The datatype belongs to the Puppet.Interpreter module because it serves to implement how Hiera is used within Puppet.
globalLayer :: forall m. Lens' (HieraQueryLayers m) (HieraQueryFunc m) Source #
environmentLayer :: forall m. Lens' (HieraQueryLayers m) (HieraQueryFunc m) Source #
moduleLayer :: forall m. Lens' (HieraQueryLayers m) (Container (HieraQueryFunc m)) Source #
Template
data TemplateSource Source #
Whether the template source is specified inline
or loaded from a file.
Instances
Pretty TemplateSource Source # | |
Defined in Puppet.Interpreter.PrettyPrinter pretty :: TemplateSource -> Doc # prettyList :: [TemplateSource] -> Doc # |
Re-export
module Puppet.Language
Pure resolution functions
:: Container ScopeInformation | The whole scope data. |
-> Text | Current scope name. |
-> Text | Full variable name. |
-> Either Doc PValue |
A pure function for resolving variables.
pValue2Bool :: PValue -> Bool Source #
Monadic resolution functions
resolveVariable :: Text -> InterpreterMonad PValue Source #
Resolves a variable, or throws an error if it can't.
resolveExpression :: Expression -> InterpreterMonad PValue Source #
The main resolution function : turns an Expression
into a PValue
,
if possible.
resolveValue :: UnresolvedValue -> InterpreterMonad PValue Source #
Resolves an UnresolvedValue
(terminal for the Expression
data type) into
a PValue
resolvePValueString :: PValue -> InterpreterMonad Text Source #
Turns strings, numbers and booleans into Text
, or throws an error.
resolvePValueNumber :: PValue -> InterpreterMonad Scientific Source #
Turns everything it can into a number, or throws an error
resolveExpressionString :: Expression -> InterpreterMonad Text Source #
resolveExpressionString = resolveExpression >=> resolvePValueString
resolveExpressionStrings :: Expression -> InterpreterMonad [Text] Source #
Just like resolveExpressionString
, but accepts arrays.
resolveFunction' :: Text -> [PValue] -> InterpreterMonad PValue Source #
runHiera :: Text -> HieraQueryType -> InterpreterMonad (Maybe PValue) Source #
A hiera helper function, that will throw all Hiera errors and log messages to the main monad.
isNativeType :: Text -> InterpreterMonad Bool Source #
A simple helper that checks if a given type is native or a define.
Search expression management
resolveSearchExpression :: SearchExpression -> InterpreterMonad RSearchExpression Source #
Turns an unresolved SearchExpression
from the parser into a fully
resolved RSearchExpression
.
checkSearchExpression :: RSearchExpression -> Resource -> Bool Source #
Checks whether a given Resource
matches a RSearchExpression
.
Note that the expression doesn't check for type, so you must filter the
resources by type beforehand, if needs be.
searchExpressionToPuppetDB :: Text -> RSearchExpression -> Query ResourceField Source #
Turns a resource type and RSearchExpression
into something that can
be used in a PuppetDB query.
Higher order puppet functions handling
hfGenerateAssociations :: HOLambdaCall -> InterpreterMonad [[(Text, PValue)]] Source #
Generates variable associations for evaluation of blocks. Each item corresponds to an iteration in the calling block.
hfSetvars :: [(Text, PValue)] -> InterpreterMonad (Container (Pair (Pair PValue PPosition) CurContainerDesc)) Source #
Sets the proper variables, and returns the scope variables the way they were before being modified. This is a hack that ensures that variables are local to the new scope.
It doesn't work at all like other Puppet parts, but consistency isn't really expected here ...
hfRestorevars :: Container (Pair (Pair PValue PPosition) CurContainerDesc) -> InterpreterMonad () Source #
Restores what needs restoring. This will erase all allocations.
Converts class resource names to lowercase (fix for the jenkins plugin).
checkMatch :: DataType -> PValue -> InterpreterMonad () Source #
interpretMonad :: Monad m => InterpreterReader m -> InterpreterState -> InterpreterMonad a -> m (Either PrettyError a, InterpreterState, InterpreterWriter) Source #
The operational interpreter function