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

Safe HaskellNone
LanguageHaskell98

Puppet.Interpreter.Types

Contents

Synopsis

Record & lenses

class HasResource c where Source

Minimal complete definition

resource

Methods

resource :: Lens' c Resource Source

ralias :: Lens' c (HashSet Text) Source

rattributes :: Lens' c (Container PValue) Source

rid :: Lens' c RIdentifier Source

rnode :: Lens' c NodeName Source

rpos :: Lens' c PPosition Source

rrelations :: Lens' c (HashMap RIdentifier (HashSet LinkType)) Source

rscope :: Lens' c [CurContainerDesc] Source

rtags :: Lens' c (HashSet Text) Source

rvirtuality :: Lens' c Virtuality Source

data Resource Source

A fully resolved puppet resource that will be used in the FinalCatalog.

Constructors

Resource !RIdentifier !(HashSet Text) !(Container PValue) !(HashMap RIdentifier (HashSet LinkType)) ![CurContainerDesc] !Virtuality !(HashSet Text) !PPosition !NodeName 

class HasResDefaults c where Source

Minimal complete definition

resDefaults

Methods

resDefaults :: Lens' c ResDefaults Source

resDefPos :: Lens' c PPosition Source

resDefSrcScope :: Lens' c Text Source

resDefType :: Lens' c Text Source

resDefValues :: Lens' c (Container PValue) Source

data ResDefaults Source

From the evaluation of Resource Default Declaration

Constructors

ResDefaults !Text !Text !(Container PValue) !PPosition 

class HasRIdentifier c where Source

Minimal complete definition

rIdentifier

Methods

rIdentifier :: Lens' c RIdentifier Source

iname :: Lens' c Text Source

itype :: Lens' c Text Source

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

class HasIoMethods c m | c -> m where Source

Minimal complete definition

ioMethods

Methods

ioMethods :: Lens' c (IoMethods m) Source

ioGetCurrentCallStack :: Lens' c (m [String]) Source

ioReadFile :: Lens' c ([Text] -> m (Either String Text)) Source

ioTraceEvent :: Lens' c (String -> m ()) Source

Instances

data IoMethods m Source

Constructors

IoMethods (m [String]) ([Text] -> m (Either String Text)) (String -> m ()) 

Instances

class HasCurContainer c where Source

Minimal complete definition

curContainer

Methods

curContainer :: Lens' c CurContainer Source

cctags :: Lens' c (HashSet Text) Source

cctype :: Lens' c CurContainerDesc Source

data CurContainer Source

TODO related to Scope: explain ...

Constructors

CurContainer !CurContainerDesc !(HashSet Text) 

data NativeTypeMethods Source

Attributes (and providers) of a puppet resource type bundled with validation rules

Constructors

NativeTypeMethods NativeTypeValidate (HashSet Text) 

data NodeInfo Source

Constructors

NodeInfo !NodeName !Bool !(Maybe UTCTime) !(Maybe UTCTime) !(Maybe UTCTime) 

class HasNodeInfo c where Source

Minimal complete definition

nodeInfo

Methods

nodeInfo :: Lens' c NodeInfo Source

nodeInfoCatalogT :: Lens' c (Maybe UTCTime) Source

nodeInfoDeactivated :: Lens' c Bool Source

nodeInfoFactsT :: Lens' c (Maybe UTCTime) Source

nodeInfoName :: Lens' c NodeName Source

nodeInfoReportT :: Lens' c (Maybe UTCTime) Source

data FactInfo Source

Constructors

FactInfo !NodeName !Text !PValue 

class HasFactInfo c where Source

Minimal complete definition

factInfo

Methods

factInfo :: Lens' c FactInfo Source

factInfoName :: Lens' c Text Source

factInfoNodename :: Lens' c NodeName Source

factInfoVal :: Lens' c PValue Source

class HasWireCatalog c where Source

Minimal complete definition

wireCatalog

Operational instructions

data InterpreterInstr a where Source

Constructors

GetNativeTypes :: InterpreterInstr (Container NativeTypeMethods) 
GetStatement :: TopLevelType -> Text -> InterpreterInstr Statement 
ComputeTemplate :: Either Text Text -> 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 
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 () 

Sum types

data PValue Source

Constructors

PBoolean !Bool 
PUndef 
PString !Text 
PResourceReference !Text !Text 
PArray !(Vector PValue) 
PHash !(Container PValue) 
PNumber !Scientific 

Instances

data CurContainerDesc Source

Constructors

ContRoot

Contained at node or root level

ContClass !Text

Contained in a class

ContDefine !Text !Text !PPosition

Contained in a define, along with the position where this define was ... defined

ContImported !CurContainerDesc

Dummy container for imported resources, so that we know we must update the nodename

ContImport !NodeName !CurContainerDesc

This one is used when finalizing imported resources, and contains the current node name

data Query a Source

Pretty straightforward way to define the various PuppetDB queries

Constructors

QEqual a Text 
QG a Integer 
QL a Integer 
QGE a Integer 
QLE a Integer 
QMatch Text Text 
QAnd [Query a] 
QOr [Query a] 
QNot (Query a) 
QEmpty 

Instances

ToJSON a => ToJSON (Query a) Source 
FromJSON a => FromJSON (Query a) Source 
ToJSON a => ToHttpApiData (Query a) Source 

data ModifierType Source

Constructors

ModifierCollector

For collectors, optional resources

ModifierMustMatch

For stuff like realize

data NodeField Source

Fields for the node endpoint

Instances

ToJSON NodeField Source 
FromJSON NodeField Source 

data Strictness Source

The intepreter can run in two modes : a strict mode (recommended), and a permissive mode. The permissive mode let known antipatterns work with the interpreter.

Constructors

Strict 
Permissive 

data HieraQueryType Source

The different kind of hiera queries

Constructors

Priority

standard hiera query

ArrayMerge

hiera_array

HashMerge

hiera_hash

data TopLevelType Source

This type is used to differenciate the distinct top level types that are exposed by the DSL.

Constructors

TopNode

This is for node entries.

TopDefine

This is for defines.

TopClass

This is for classes.

data FactField Source

Fields for the fact endpoint

Constructors

FName 
FValue 
FCertname 

Instances

ToJSON FactField Source 
FromJSON FactField Source 

data ResRefOverride Source

From the evaluation of Resource Override Declaration

data ResourceField Source

Fields for the resource endpoint

Instances

data OverrideType Source

Constructors

CantOverride

Overriding forbidden, will throw an error

Replace

Can silently replace

CantReplace

Silently ignore errors

AppendAttribute

Can append values

data ClassIncludeType Source

Puppet has two main ways to declare classes: include-like and resource-like https://docs.puppetlabs.com/puppet/latest/reference/lang_classes.html#include-like-vs-resource-like

Constructors

ClassIncludeLike

using the include or contain function

ClassResourceLike

resource like declaration

PuppetDB

data PuppetEdge Source

Used to represent a relationship between two resources within the wired format (json). See http://docs.puppetlabs.com/puppetdb/2.3/api/wire_format/catalog_format_v5.html#data-type-edge

Instances

newtype & synonym

type InterpreterWriter = [Pair Priority Doc] Source

Log

type NodeName = Text Source

type Container = HashMap Text Source

type HieraQueryFunc m Source

Arguments

 = Container Text

All the variables that Hiera can interpolate, the top level ones being prefixed with ::

-> Text

The query

-> HieraQueryType 
-> m (Either PrettyError (Maybe PValue)) 

The type of the Hiera API function

type Scope = Text Source

Classes

definitions

metaparameters :: HashSet Text Source