| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Puppet.Interpreter
Contents
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
- extractFromState :: InterpreterState -> Maybe (Text, Container ScopeInformation)
- containerModName :: CurContainerDesc -> Text
- 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)
- 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
- 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
- GetNodeName :: InterpreterInstr Text
- HieraQuery :: Container Text -> 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
- 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)
- 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 ()
- interpretMonad :: Monad m => InterpreterReader m -> InterpreterState -> InterpreterMonad a -> m (Either PrettyError a, InterpreterState, InterpreterWriter)
Documentation
Arguments
| :: 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]) #
Main internal entry point, this function completes the interpretation TODO: add some doc here
Utils
Arguments
| :: Facts | |
| -> Container Text | Server settings |
| -> InterpreterState |
Operational state
data InterpreterState #
Constructors
Instances
| MonadThrowPos InterpreterMonad # | |
Defined in Puppet.Interpreter.Types Methods throwPosError :: Doc -> InterpreterMonad a # | |
| MonadError PrettyError InterpreterMonad # | |
Defined in Puppet.Interpreter.Types Methods throwError :: PrettyError -> InterpreterMonad a # catchError :: InterpreterMonad a -> (PrettyError -> InterpreterMonad a) -> InterpreterMonad a # | |
| MonadWriter InterpreterWriter InterpreterMonad # | |
Defined in Puppet.Interpreter.Types Methods 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 #
Constructors
| 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) |
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 #
readerRebaseFile :: forall m. Lens' (InterpreterReader m) (Maybe FilePath) #
Interpreter monad
type InterpreterMonad = ProgramT InterpreterInstr (State InterpreterState) #
The main monad
type InterpreterWriter = [Pair Priority Doc] #
Log
data InterpreterInstr a where #
Constructors
Instances
| MonadThrowPos InterpreterMonad # | |
Defined in Puppet.Interpreter.Types Methods throwPosError :: Doc -> InterpreterMonad a # | |
| MonadError PrettyError InterpreterMonad # | |
Defined in Puppet.Interpreter.Types Methods throwError :: PrettyError -> InterpreterMonad a # catchError :: InterpreterMonad a -> (PrettyError -> InterpreterMonad a) -> InterpreterMonad a # | |
| MonadWriter InterpreterWriter InterpreterMonad # | |
Defined in Puppet.Interpreter.Types Methods writer :: (a, InterpreterWriter) -> InterpreterMonad a # tell :: InterpreterWriter -> InterpreterMonad () # listen :: InterpreterMonad a -> InterpreterMonad (a, InterpreterWriter) # pass :: InterpreterMonad (a, InterpreterWriter -> InterpreterWriter) -> InterpreterMonad a # | |
| Pretty (InterpreterInstr a) # | |
Defined in Puppet.Interpreter.PrettyPrinter | |
data Strictness #
The intepreter can run in two modes : a strict mode (recommended), and a permissive mode.
Constructors
| Strict | |
| Permissive |
Instances
| Eq Strictness # | |
Defined in Puppet.Interpreter.Types | |
| Show Strictness # | |
Defined in Puppet.Interpreter.Types Methods showsPrec :: Int -> Strictness -> ShowS # show :: Strictness -> String # showList :: [Strictness] -> ShowS # | |
| FromJSON Strictness # | |
Defined in Puppet.Interpreter.Types | |
Io methods
ioGetCurrentCallStack :: forall m. Lens' (IoMethods m) (m [String]) #
ioTraceEvent :: forall m. Lens' (IoMethods m) (String -> m ()) #
class Monad m => MonadThrowPos m where #
Minimal complete definition
Methods
throwPosError :: Doc -> m a #
Instances
| MonadThrowPos InterpreterMonad # | |
Defined in Puppet.Interpreter.Types Methods throwPosError :: Doc -> InterpreterMonad a # | |
| MonadThrowPos (Either Doc) # | |
Defined in Puppet.Interpreter.Types Methods throwPosError :: Doc -> Either Doc a # | |
Resource modifier
data ResourceModifier #
Constructors
| ResourceModifier !Text !ModifierType !ResourceCollectorType !RSearchExpression !(Resource -> InterpreterMonad Resource) !PPosition |
Instances
| Show ResourceModifier # | |
Defined in Puppet.Interpreter.Types Methods showsPrec :: Int -> ResourceModifier -> ShowS # show :: ResourceModifier -> String # showList :: [ResourceModifier] -> ShowS # | |
| Pretty ResourceModifier # | |
Defined in Puppet.Interpreter.PrettyPrinter | |
data ModifierType #
Constructors
| ModifierCollector | For collectors, optional resources |
| ModifierMustMatch | For stuff like realize |
Instances
| Eq ModifierType # | |
Defined in Puppet.Interpreter.Types | |
| Show ModifierType # | |
Defined in Puppet.Interpreter.Types Methods showsPrec :: Int -> ModifierType -> ShowS # show :: ModifierType -> String # showList :: [ModifierType] -> ShowS # | |
data OverrideType #
Constructors
| CantOverride | Overriding forbidden, will throw an error |
| Replace | Can silently replace |
| CantReplace | Silently ignore errors |
| AppendAttribute | Can append values |
Instances
| Eq OverrideType # | |
Defined in Puppet.Interpreter.Types | |
| Show OverrideType # | |
Defined in Puppet.Interpreter.Types Methods showsPrec :: Int -> OverrideType -> ShowS # show :: OverrideType -> String # showList :: [OverrideType] -> ShowS # | |
data ResourceCollectorType #
Constructors
| RealizeVirtual | |
| RealizeCollected | |
| DontRealize |
Instances
| Eq ResourceCollectorType # | |
Defined in Puppet.Interpreter.Types Methods (==) :: ResourceCollectorType -> ResourceCollectorType -> Bool # (/=) :: ResourceCollectorType -> ResourceCollectorType -> Bool # | |
| Show ResourceCollectorType # | |
Defined in Puppet.Interpreter.Types Methods showsPrec :: Int -> ResourceCollectorType -> ShowS # show :: ResourceCollectorType -> String # showList :: [ResourceCollectorType] -> ShowS # | |
data ClassIncludeType #
Puppet has two main ways to declare classes: include-like and resource-like.
See puppet reference.
Constructors
| ClassIncludeLike | Using the include or contain function |
| ClassResourceLike | Resource like declaration |
Instances
| Eq ClassIncludeType # | |
Defined in Puppet.Interpreter.Types Methods (==) :: ClassIncludeType -> ClassIncludeType -> Bool # (/=) :: ClassIncludeType -> ClassIncludeType -> Bool # | |
data RSearchExpression #
Constructors
| REqualitySearch !Text !PValue | |
| RNonEqualitySearch !Text !PValue | |
| RAndSearch !RSearchExpression !RSearchExpression | |
| ROrSearch !RSearchExpression !RSearchExpression | |
| RAlwaysTrue |
Instances
| Eq RSearchExpression # | |
Defined in Puppet.Interpreter.Types Methods (==) :: RSearchExpression -> RSearchExpression -> Bool # (/=) :: RSearchExpression -> RSearchExpression -> Bool # | |
| Show RSearchExpression # | |
Defined in Puppet.Interpreter.Types Methods showsPrec :: Int -> RSearchExpression -> ShowS # show :: RSearchExpression -> String # showList :: [RSearchExpression] -> ShowS # | |
| Pretty RSearchExpression # | |
Defined in Puppet.Interpreter.PrettyPrinter | |
Scope information
data ScopeInformation #
Constructors
| ScopeInformation !(Container (Pair (Pair PValue PPosition) CurContainerDesc)) !(Container ResDefaults) !(HashSet Text) !CurContainer !(HashMap RIdentifier ResRefOverride) !(Maybe Text) |
scopeVariables :: Lens' ScopeInformation (Container (Pair (Pair PValue PPosition) CurContainerDesc)) #
data CurContainer #
The type of the container together with its tags.
Constructors
| CurContainer !CurContainerDesc !(HashSet Text) |
Instances
| Eq CurContainer # | |
Defined in Puppet.Interpreter.Types | |
Resource default
data ResDefaults #
From the evaluation of Resource Default Declaration.
Instances
| Pretty ResDefaults # | |
Defined in Puppet.Interpreter.PrettyPrinter | |
data ResRefOverride #
From the evaluation of Resource Override Declaration.
Constructors
| ResRefOverride | |
Instances
| Eq ResRefOverride # | |
Defined in Puppet.Interpreter.Types Methods (==) :: ResRefOverride -> ResRefOverride -> Bool # (/=) :: ResRefOverride -> ResRefOverride -> Bool # | |
data ScopeEnteringContext #
data TopLevelType #
Differentiate the distinct top level types such as node, define or class.
Instances
| Eq TopLevelType # | |
Defined in Puppet.Interpreter.Types | |
| Generic TopLevelType # | |
Defined in Puppet.Interpreter.Types Associated Types type Rep TopLevelType :: * -> * # | |
| Hashable TopLevelType # | |
Defined in Puppet.Interpreter.Types | |
| Pretty TopLevelType # | |
Defined in Puppet.Interpreter.PrettyPrinter | |
| type Rep TopLevelType # | |
Defined in Puppet.Interpreter.Types type Rep TopLevelType = D1 (MetaData "TopLevelType" "Puppet.Interpreter.Types" "language-puppet-1.3.19-6UDNik9BeMl8D41nYcdUxM" False) (C1 (MetaCons "TopNode" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "TopDefine" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "TopClass" PrefixI False) (U1 :: * -> *))) | |
Hiera
data HieraQueryLayers m #
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.
Constructors
| HieraQueryLayers | |
Fields
| |
globalLayer :: forall m. Lens' (HieraQueryLayers m) (HieraQueryFunc m) #
moduleLayer :: forall m. Lens' (HieraQueryLayers m) (Container (HieraQueryFunc m)) #
Template
data TemplateSource #
Whether the template source is specified inline or loaded from a file.
Instances
| Pretty TemplateSource # | |
Defined in Puppet.Interpreter.PrettyPrinter | |
Re-export
module Puppet.Language
Pure resolution functions
Arguments
| :: 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 #
Monadic resolution functions
resolveVariable :: Text -> InterpreterMonad PValue #
Resolves a variable, or throws an error if it can't.
resolveExpression :: Expression -> InterpreterMonad PValue #
The main resolution function : turns an Expression into a PValue,
if possible.
resolveValue :: UnresolvedValue -> InterpreterMonad PValue #
Resolves an UnresolvedValue (terminal for the Expression data type) into
a PValue
resolvePValueString :: PValue -> InterpreterMonad Text #
Turns strings, numbers and booleans into Text, or throws an error.
resolvePValueNumber :: PValue -> InterpreterMonad Scientific #
Turns everything it can into a number, or throws an error
resolveExpressionString :: Expression -> InterpreterMonad Text #
resolveExpressionString = resolveExpression >=> resolvePValueString
resolveExpressionStrings :: Expression -> InterpreterMonad [Text] #
Just like resolveExpressionString, but accepts arrays.
resolveFunction' :: Text -> [PValue] -> InterpreterMonad PValue #
runHiera :: Text -> HieraQueryType -> InterpreterMonad (Maybe PValue) #
A hiera helper function, that will throw all Hiera errors and log messages to the main monad.
isNativeType :: Text -> InterpreterMonad Bool #
A simple helper that checks if a given type is native or a define.
Search expression management
resolveSearchExpression :: SearchExpression -> InterpreterMonad RSearchExpression #
Turns an unresolved SearchExpression from the parser into a fully
resolved RSearchExpression.
checkSearchExpression :: RSearchExpression -> Resource -> Bool #
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 #
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)]] #
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)) #
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 () #
Restores what needs restoring. This will erase all allocations.
Converts class resource names to lowercase (fix for the jenkins plugin).
datatypeMatch :: DataType -> PValue -> Bool #
Checks that a value matches a puppet datatype
checkMatch :: DataType -> PValue -> InterpreterMonad () #
interpretMonad :: Monad m => InterpreterReader m -> InterpreterState -> InterpreterMonad a -> m (Either PrettyError a, InterpreterState, InterpreterWriter) #
The operational interpreter function