language-puppet-0.12.3: Tools to parse and evaluate the Puppet DSL.

Safe HaskellNone

Puppet.Interpreter

Synopsis

Documentation

vmapM :: (Monad m, Foldable t) => (a -> m b) -> t a -> m [b]Source

getCatalogSource

Arguments

:: Monad m 
=> (InterpreterReader m -> InterpreterState -> InterpreterMonad (FinalCatalog, EdgeMap, FinalCatalog, [Resource]) -> m (Either Doc (FinalCatalog, EdgeMap, FinalCatalog, [Resource]), InterpreterState, InterpreterWriter))

A function that will interpret the InterpreterMonad and will convert it to something else (for example, interpretIO)

-> (TopLevelType -> Text -> m (Either Doc Statement))

get statements function

-> (Either Text Text -> Text -> Container ScopeInformation -> m (Either Doc Text))

compute template function

-> PuppetDBAPI m 
-> Text

Node name

-> Facts

Facts ...

-> Container PuppetTypeMethods

List of native types

-> Container ([PValue] -> InterpreterMonad PValue) 
-> HieraQueryFunc m

Hiera query function

-> ImpureMethods m 
-> m (Pair (Either Doc (FinalCatalog, EdgeMap, FinalCatalog, [Resource])) [Pair Priority Doc]) 

This is the main function for computing catalogs. It returns the result of the compulation (either an error, or a tuple containing all the resources, dependency map, exported resources, and defined resources (this last one might not be up to date and is only useful for code coverage tests)) along with all messages that have been generated by the compilation process.

fromArgumentList :: [Pair Text a] -> InterpreterMonad (Container a)Source

Converts a list of pairs into a container, checking there is no duplicate

loadParameters :: Foldable f => Container PValue -> f (Pair Text (Maybe Expression)) -> PPosition -> Maybe Text -> InterpreterMonad ()Source

This function loads class and define parameters into scope. It checks that all mandatory parameters are set, that no extra parameter is declared.

It is able to fill unset parameters with values from Hiera (for classes only) or default values.

data ScopeEnteringContext Source

Constructors

SENormal 
SEChild !Text

We enter the scope as the child of another class

SEParent !Text

We enter the scope as the parent of another class

enterScope :: ScopeEnteringContext -> CurContainerDesc -> Text -> PPosition -> InterpreterMonad TextSource

Enters a new scope, checks it is not already defined, and inherits the defaults from the current scope

Inheriting the defaults is necessary for non native types, because they will be expanded in finalize, so if this was not done, we would be expanding the defines without the defaults applied

loadClassSource

Arguments

:: Text 
-> Maybe Text

Set if this is an inheritance load, so that we can set calling module properly

-> Container PValue 
-> ClassIncludeType 
-> InterpreterMonad [Resource]