-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Tools to parse and evaluate the Puppet DSL. -- -- This is a set of tools that is supposed to fill all your Puppet needs -- : syntax checks, catalog compilation, PuppetDB queries, simulationg of -- complex interactions between nodes, Puppet master replacement, and -- more ! @package language-puppet @version 1.0.0 -- | Base types for the internal ruby parser (Erb.Parser). module Erb.Ruby data Value Literal :: !Text -> Value Interpolable :: ![Expression] -> Value Symbol :: !Text -> Value Array :: ![Expression] -> Value data Expression LookupOperation :: !Expression -> !Expression -> Expression PlusOperation :: !Expression -> !Expression -> Expression MinusOperation :: !Expression -> !Expression -> Expression DivOperation :: !Expression -> !Expression -> Expression MultiplyOperation :: !Expression -> !Expression -> Expression ShiftLeftOperation :: !Expression -> !Expression -> Expression ShiftRightOperation :: !Expression -> !Expression -> Expression AndOperation :: !Expression -> !Expression -> Expression OrOperation :: !Expression -> !Expression -> Expression EqualOperation :: !Expression -> !Expression -> Expression DifferentOperation :: !Expression -> !Expression -> Expression AboveOperation :: !Expression -> !Expression -> Expression AboveEqualOperation :: !Expression -> !Expression -> Expression UnderEqualOperation :: !Expression -> !Expression -> Expression UnderOperation :: !Expression -> !Expression -> Expression RegexpOperation :: !Expression -> !Expression -> Expression NotRegexpOperation :: !Expression -> !Expression -> Expression NotOperation :: !Expression -> Expression NegOperation :: !Expression -> Expression ConditionalValue :: !Expression -> !Expression -> Expression Object :: !Expression -> Expression MethodCall :: !Expression -> !Expression -> Expression BlockOperation :: !Text -> Expression Value :: !Value -> Expression BTrue :: Expression BFalse :: Expression Error :: !String -> Expression data RubyStatement Puts :: !Expression -> RubyStatement DropPrevSpace :: !RubyStatement -> RubyStatement DropPrevSpace' :: RubyStatement DropNextSpace :: !RubyStatement -> RubyStatement instance Show Expression instance Ord Expression instance Eq Expression instance Show Value instance Ord Value instance Eq Value instance Show RubyStatement instance Eq RubyStatement instance Pretty Expression module Erb.Parser def :: GenLanguageDef String u Identity lexer :: GenTokenParser String u Identity parens :: Parser a -> Parser a braces :: Parser a -> Parser a operator :: Parser String symbol :: String -> Parser String reservedOp :: String -> Parser () whiteSpace :: Parser () naturalOrFloat :: Parser (Either Integer Double) identifier :: Parser String rubyexpression :: Parser Expression table :: [[Operator String () Identity Expression]] term :: Parser Expression scopeLookup :: Parser Expression stringLiteral :: Parser Expression doubleQuoted :: Parser Value singleQuoted :: Parser Value objectterm :: Parser Expression variablereference :: Parser Expression rubystatement :: Parser RubyStatement textblockW :: Maybe Char -> Parser [RubyStatement] textblock :: Parser [RubyStatement] rubyblock :: Parser [RubyStatement] erbparser :: Parser [RubyStatement] parseErbFile :: FilePath -> IO (Either ParseError [RubyStatement]) parseErbString :: String -> Either ParseError [RubyStatement] module SafeProcess safeReadProcessTimeout :: String -> [String] -> Text -> Int -> IO (Maybe (Either String Text)) safeCreateProcess :: String -> [String] -> StdStream -> StdStream -> StdStream -> ((Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO a) -> IO a safeReadProcess :: String -> [String] -> Text -> IO (Either String Text) terminateProcessGroup :: ProcessHandle -> IO () module Puppet.PP ttext :: Text -> Doc tshow :: Show a => a -> Text dq :: Text -> Text pshow :: Doc -> String -- | A rendering function that drops colors: displayNocolor :: Doc -> String -- | A quickly done module that exports utility functions used to collect -- various statistics. All statistics are stored in a MVar holding a -- HashMap. -- -- This is not accurate in the presence of lazy evaluation. Nothing is -- forced. module Puppet.Stats -- | Wraps a computation, and measures related execution statistics. measure :: MStats -> Text -> IO a -> IO a -- | Just like measure, discarding the result value. measure_ :: MStats -> Text -> IO a -> IO () -- | Create a new statistical container. newStats :: IO MStats -- | Returns the actual statistical values. getStats :: MStats -> IO StatsTable -- | A table where keys are the names of the computations, and values are -- StatsPoints. type StatsTable = HashMap Text StatsPoint data StatsPoint StatsPoint :: !Int -> !Double -> !Double -> !Double -> StatsPoint -- | Total number of calls to a computation _statspointCount :: StatsPoint -> !Int -- | Total time spent during this computation _statspointTotal :: StatsPoint -> !Double -- | Minimum execution time _statspointMin :: StatsPoint -> !Double -- | Maximum execution time _statspointMax :: StatsPoint -> !Double data MStats instance Show StatsPoint -- | All the types used for parsing, and helpers working on these types. module Puppet.Parser.Types -- | Position in a puppet file. Currently an alias to SourcePos. type Position = SourcePos -- | A pair containing the start and end of a given token. type PPosition = Pair Position Position -- | Generates an initial position based on a filename. initialPPos :: Text -> PPosition -- | Generates a PPosition based on a filename and line number. toPPos :: Text -> Int -> PPosition lSourceName :: Lens' Position SourceName lSourceLine :: Lens' Position Line lSourceColumn :: Lens' Position Column capitalize' :: Text -> Text -- | Properly capitalizes resource types capitalizeRT :: Text -> Text -- | A helper function for writing arrays. array :: [Expression] -> UValue -- | Tries to turn an unresolved value into a Bool without any -- context. toBool :: UValue -> Bool rel2text :: LinkType -> Text -- | The Expressions data Expression Equal :: !Expression -> !Expression -> Expression Different :: !Expression -> !Expression -> Expression Not :: !Expression -> Expression And :: !Expression -> !Expression -> Expression Or :: !Expression -> !Expression -> Expression LessThan :: !Expression -> !Expression -> Expression MoreThan :: !Expression -> !Expression -> Expression LessEqualThan :: !Expression -> !Expression -> Expression MoreEqualThan :: !Expression -> !Expression -> Expression RegexMatch :: !Expression -> !Expression -> Expression NotRegexMatch :: !Expression -> !Expression -> Expression Contains :: !Expression -> !Expression -> Expression Addition :: !Expression -> !Expression -> Expression Substraction :: !Expression -> !Expression -> Expression Division :: !Expression -> !Expression -> Expression Multiplication :: !Expression -> !Expression -> Expression Modulo :: !Expression -> !Expression -> Expression RightShift :: !Expression -> !Expression -> Expression LeftShift :: !Expression -> !Expression -> Expression Lookup :: !Expression -> !Expression -> Expression Negate :: !Expression -> Expression -- | All conditionals are stored in this format. ConditionalValue :: !Expression -> !(Vector (Pair SelectorCase Expression)) -> Expression -- | This is for higher order functions. FunctionApplication :: !Expression -> !Expression -> Expression PValue :: !UValue -> Expression data SelectorCase SelectorValue :: UValue -> SelectorCase SelectorDefault :: SelectorCase -- | An unresolved value, typically the parser's output. data UValue -- | Special tokens generated when parsing the true or -- false literals. UBoolean :: !Bool -> UValue -- | Raw string. UString :: !Text -> UValue -- | A string that might contain variable references. The type should be -- refined at one point. UInterpolable :: !(Vector UValue) -> UValue -- | Special token that is generated when parsing the undef -- literal. UUndef :: UValue -- | A Resource[reference] UResourceReference :: !Text -> !Expression -> UValue UArray :: !(Vector Expression) -> UValue UHash :: !(Vector (Pair Expression Expression)) -> UValue -- | The regular expression compilation is performed during parsing. URegexp :: !Text -> !Regex -> UValue UVariableReference :: !Text -> UValue UFunctionCall :: !Text -> !(Vector Expression) -> UValue UHFunctionCall :: !HFunctionCall -> UValue UNumber :: Scientific -> UValue -- | The distinct Puppet higher order functions data HigherFuncType HFEach :: HigherFuncType HFMap :: HigherFuncType HFReduce :: HigherFuncType HFFilter :: HigherFuncType HFSlice :: HigherFuncType data HFunctionCall HFunctionCall :: !HigherFuncType -> !(Maybe Expression) -> !BlockParameters -> !(Vector Statement) -> !(Maybe Expression) -> HFunctionCall _hftype :: HFunctionCall -> !HigherFuncType _hfexpr :: HFunctionCall -> !(Maybe Expression) _hfparams :: HFunctionCall -> !BlockParameters _hfstatements :: HFunctionCall -> !(Vector Statement) _hfexpression :: HFunctionCall -> !(Maybe Expression) class HasHFunctionCall t_ajTj where hfexpr = (hFunctionCall . go_ajTl) where go_ajTl _f_ajTm (HFunctionCall __hftype_ajTn __hfexpr'_ajTo __hfparams_ajTq __hfstatements_ajTr __hfexpression_ajTs) = ((\ __hfexpr_ajTp -> HFunctionCall __hftype_ajTn __hfexpr_ajTp __hfparams_ajTq __hfstatements_ajTr __hfexpression_ajTs) <$> (_f_ajTm __hfexpr'_ajTo)) hfexpression = (hFunctionCall . go_ajTt) where go_ajTt _f_ajTu (HFunctionCall __hftype_ajTv __hfexpr_ajTw __hfparams_ajTx __hfstatements_ajTy __hfexpression'_ajTz) = ((\ __hfexpression_ajTA -> HFunctionCall __hftype_ajTv __hfexpr_ajTw __hfparams_ajTx __hfstatements_ajTy __hfexpression_ajTA) <$> (_f_ajTu __hfexpression'_ajTz)) hfparams = (hFunctionCall . go_ajTB) where go_ajTB _f_ajTC (HFunctionCall __hftype_ajTD __hfexpr_ajTE __hfparams'_ajTF __hfstatements_ajTH __hfexpression_ajTI) = ((\ __hfparams_ajTG -> HFunctionCall __hftype_ajTD __hfexpr_ajTE __hfparams_ajTG __hfstatements_ajTH __hfexpression_ajTI) <$> (_f_ajTC __hfparams'_ajTF)) hfstatements = (hFunctionCall . go_ajTJ) where go_ajTJ _f_ajTK (HFunctionCall __hftype_ajTL __hfexpr_ajTM __hfparams_ajTN __hfstatements'_ajTO __hfexpression_ajTQ) = ((\ __hfstatements_ajTP -> HFunctionCall __hftype_ajTL __hfexpr_ajTM __hfparams_ajTN __hfstatements_ajTP __hfexpression_ajTQ) <$> (_f_ajTK __hfstatements'_ajTO)) hftype = (hFunctionCall . go_ajTR) where go_ajTR _f_ajTS (HFunctionCall __hftype'_ajTT __hfexpr_ajTV __hfparams_ajTW __hfstatements_ajTX __hfexpression_ajTY) = ((\ __hftype_ajTU -> HFunctionCall __hftype_ajTU __hfexpr_ajTV __hfparams_ajTW __hfstatements_ajTX __hfexpression_ajTY) <$> (_f_ajTS __hftype'_ajTT)) hFunctionCall :: HasHFunctionCall t_ajTj => Lens' t_ajTj HFunctionCall hfexpr :: HasHFunctionCall t_ajTj => Lens' t_ajTj (Maybe Expression) hfexpression :: HasHFunctionCall t_ajTj => Lens' t_ajTj (Maybe Expression) hfparams :: HasHFunctionCall t_ajTj => Lens' t_ajTj BlockParameters hfstatements :: HasHFunctionCall t_ajTj => Lens' t_ajTj (Vector Statement) hftype :: HasHFunctionCall t_ajTj => Lens' t_ajTj HigherFuncType -- | Currently only two types of block parameters are supported, single -- values and pairs. data BlockParameters -- |
--   |k|
--   
BPSingle :: !Text -> BlockParameters -- |
--   |k,v|
--   
BPPair :: !Text -> !Text -> BlockParameters data CollectorType Collector :: CollectorType ExportedCollector :: CollectorType data Virtuality -- | Normal resource, that will be included in the catalog Normal :: Virtuality -- | Type for virtual resources Virtual :: Virtuality -- | Type for exported resources Exported :: Virtuality -- | These are resources that are exported AND included in the catalog ExportedRealized :: Virtuality data NodeDesc NodeName :: !Text -> NodeDesc NodeMatch :: !Text -> !Regex -> NodeDesc NodeDefault :: NodeDesc -- | Relationship link type. data LinkType RNotify :: LinkType RRequire :: LinkType RBefore :: LinkType RSubscribe :: LinkType data SearchExpression EqualitySearch :: !Text -> !Expression -> SearchExpression NonEqualitySearch :: !Text -> !Expression -> SearchExpression AndSearch :: !SearchExpression -> !SearchExpression -> SearchExpression OrSearch :: !SearchExpression -> !SearchExpression -> SearchExpression AlwaysTrue :: SearchExpression -- | All the possible statements data Statement ResourceDeclaration :: !Text -> !Expression -> !(Vector (Pair Text Expression)) -> !Virtuality -> !PPosition -> Statement DefaultDeclaration :: !Text -> !(Vector (Pair Text Expression)) -> !PPosition -> Statement ResourceOverride :: !Text -> !Expression -> !(Vector (Pair Text Expression)) -> !PPosition -> Statement -- | All types of conditional statements are stored that way -- (case, if, etc.) ConditionalStatement :: !(Vector (Pair Expression (Vector Statement))) -> !PPosition -> Statement ClassDeclaration :: !Text -> !(Vector (Pair Text (Maybe Expression))) -> !(Maybe Text) -> !(Vector Statement) -> !PPosition -> Statement DefineDeclaration :: !Text -> !(Vector (Pair Text (Maybe Expression))) -> !(Vector Statement) -> !PPosition -> Statement Node :: !NodeDesc -> !(Vector Statement) -> !(Maybe NodeDesc) -> !PPosition -> Statement VariableAssignment :: !Text -> !Expression -> !PPosition -> Statement MainFunctionCall :: !Text -> !(Vector Expression) -> !PPosition -> Statement -- | Higher order function call. SHFunctionCall :: !HFunctionCall -> !PPosition -> Statement -- | For all types of collectors. ResourceCollection :: !CollectorType -> !Text -> !SearchExpression -> !(Vector (Pair Text Expression)) -> !PPosition -> Statement Dependency :: !(Pair Text Expression) -> !(Pair Text Expression) -> !LinkType -> !PPosition -> Statement -- | This is a special statement that is used to include the expressions -- that are top level. This is certainly buggy, but probably just like -- the original implementation. TopContainer :: !(Vector Statement) -> !Statement -> Statement instance HasHFunctionCall HFunctionCall instance Eq HigherFuncType instance Eq BlockParameters instance Eq CollectorType instance Generic Virtuality instance Eq Virtuality instance Show LinkType instance Eq LinkType instance Generic LinkType instance Eq Statement instance Eq SearchExpression instance Eq Expression instance Eq SelectorCase instance Eq HFunctionCall instance Datatype D1Virtuality instance Constructor C1_0Virtuality instance Constructor C1_1Virtuality instance Constructor C1_2Virtuality instance Constructor C1_3Virtuality instance Datatype D1LinkType instance Constructor C1_0LinkType instance Constructor C1_1LinkType instance Constructor C1_2LinkType instance Constructor C1_3LinkType instance ToJSON LinkType instance FromJSON LinkType instance Hashable LinkType instance Eq NodeDesc instance IsString Expression instance Fractional Expression instance Num Expression instance Eq UValue instance IsString UValue module Puppet.Parser.PrettyPrinter capitalize :: Text -> Doc parensList :: Pretty a => Vector a -> Doc hashComma :: (Pretty a, Pretty b) => Vector (Pair a b) -> Doc stringEscape :: Text -> Text showPos :: Position -> Doc showPPos :: PPosition -> Doc showAss :: Vector (Pair Text Expression) -> Doc showArgs :: Vector (Pair Text (Maybe Expression)) -> Doc showFunc :: Text -> Vector Expression -> Doc braceStatements :: Vector Statement -> Doc ppStatements :: Vector Statement -> Doc instance Pretty Statement instance Pretty NodeDesc instance Pretty LinkType instance Pretty SelectorCase instance Pretty HFunctionCall instance Pretty UValue instance Pretty SearchExpression instance Pretty BlockParameters instance Pretty HigherFuncType instance Pretty Expression module Puppet.Interpreter.Types metaparameters :: HashSet Text type Nodename = Text type Container = HashMap Text newtype PrettyError PrettyError :: Doc -> PrettyError getError :: PrettyError -> Doc data PValue PBoolean :: !Bool -> PValue PUndef :: PValue PString :: !Text -> PValue PResourceReference :: !Text -> !Text -> PValue PArray :: !(Vector PValue) -> PValue PHash :: !(Container PValue) -> PValue PNumber :: !Scientific -> PValue -- | The different kind of hiera queries data HieraQueryType -- | standard hiera query Priority :: HieraQueryType -- | hiera_array ArrayMerge :: HieraQueryType -- | hiera_hash HashMerge :: HieraQueryType -- | The type of the Hiera API function type HieraQueryFunc m = Container Text -> Text -> HieraQueryType -> m (Either PrettyError (Pair InterpreterWriter (Maybe PValue))) data RSearchExpression REqualitySearch :: !Text -> !PValue -> RSearchExpression RNonEqualitySearch :: !Text -> !PValue -> RSearchExpression RAndSearch :: !RSearchExpression -> !RSearchExpression -> RSearchExpression ROrSearch :: !RSearchExpression -> !RSearchExpression -> RSearchExpression RAlwaysTrue :: RSearchExpression data ClassIncludeType IncludeStandard :: ClassIncludeType IncludeResource :: ClassIncludeType type Scope = Text type Facts = Container PValue -- | This type is used to differenciate the distinct top level types that -- are exposed by the DSL. data TopLevelType -- | This is for node entries. TopNode :: TopLevelType -- | This is for defines. TopDefine :: TopLevelType -- | This is for classes. TopClass :: TopLevelType -- | This one is special. It represents top level statements that are not -- part of a node, define or class. It is defined as spurious because it -- is not what you are supposed to be. Also the caching system doesn't -- like them too much right now. TopSpurious :: TopLevelType data ResDefaults ResDefaults :: !Text -> !Text -> !(Container PValue) -> !PPosition -> ResDefaults _defType :: ResDefaults -> !Text _defSrcScope :: ResDefaults -> !Text _defValues :: ResDefaults -> !(Container PValue) _defPos :: ResDefaults -> !PPosition data CurContainerDesc -- | Contained at node or root level ContRoot :: CurContainerDesc -- | Contained in a class ContClass :: !Text -> CurContainerDesc -- | Contained in a define, along with the position where this define was -- ... defined ContDefine :: !Text -> !Text -> !PPosition -> CurContainerDesc -- | Dummy container for imported resources, so that we know we must update -- the nodename ContImported :: !CurContainerDesc -> CurContainerDesc -- | This one is used when finalizing imported resources, and contains the -- current node name ContImport :: !Nodename -> !CurContainerDesc -> CurContainerDesc data CurContainer CurContainer :: !CurContainerDesc -> !(HashSet Text) -> CurContainer _cctype :: CurContainer -> !CurContainerDesc _cctags :: CurContainer -> !(HashSet Text) data ResRefOverride ResRefOverride :: !RIdentifier -> !(Container PValue) -> !PPosition -> ResRefOverride _rrid :: ResRefOverride -> !RIdentifier _rrparams :: ResRefOverride -> !(Container PValue) _rrpos :: ResRefOverride -> !PPosition data ScopeInformation ScopeInformation :: !(Container (Pair (Pair PValue PPosition) CurContainerDesc)) -> !(Container ResDefaults) -> !(HashSet Text) -> !CurContainer -> !(HashMap RIdentifier ResRefOverride) -> !(Maybe Text) -> ScopeInformation _scopeVariables :: ScopeInformation -> !(Container (Pair (Pair PValue PPosition) CurContainerDesc)) _scopeDefaults :: ScopeInformation -> !(Container ResDefaults) _scopeExtraTags :: ScopeInformation -> !(HashSet Text) _scopeContainer :: ScopeInformation -> !CurContainer _scopeOverrides :: ScopeInformation -> !(HashMap RIdentifier ResRefOverride) _scopeParent :: ScopeInformation -> !(Maybe Text) data InterpreterState InterpreterState :: !(Container ScopeInformation) -> !(Container (Pair ClassIncludeType PPosition)) -> !(HashMap RIdentifier Resource) -> ![CurContainerDesc] -> !PPosition -> !(HashMap (TopLevelType, Text) Statement) -> ![LinkInformation] -> ![ResourceModifier] -> InterpreterState _scopes :: InterpreterState -> !(Container ScopeInformation) _loadedClasses :: InterpreterState -> !(Container (Pair ClassIncludeType PPosition)) _definedResources :: InterpreterState -> !(HashMap RIdentifier Resource) _curScope :: InterpreterState -> ![CurContainerDesc] _curPos :: InterpreterState -> !PPosition _nestedDeclarations :: InterpreterState -> !(HashMap (TopLevelType, Text) Statement) _extraRelations :: InterpreterState -> ![LinkInformation] _resMod :: InterpreterState -> ![ResourceModifier] data InterpreterReader m InterpreterReader :: !(Container PuppetTypeMethods) -> (TopLevelType -> Text -> m (Either PrettyError Statement)) -> (Either Text Text -> Text -> Container ScopeInformation -> m (Either PrettyError Text)) -> PuppetDBAPI m -> Container ([PValue] -> InterpreterMonad PValue) -> Text -> HieraQueryFunc m -> ImpureMethods m -> HashSet Text -> InterpreterReader m _nativeTypes :: InterpreterReader m -> !(Container PuppetTypeMethods) _getStatement :: InterpreterReader m -> TopLevelType -> Text -> m (Either PrettyError Statement) _computeTemplateFunction :: InterpreterReader m -> Either Text Text -> Text -> Container ScopeInformation -> m (Either PrettyError Text) _pdbAPI :: InterpreterReader m -> PuppetDBAPI m _externalFunctions :: InterpreterReader m -> Container ([PValue] -> InterpreterMonad PValue) _thisNodename :: InterpreterReader m -> Text _hieraQuery :: InterpreterReader m -> HieraQueryFunc m _ioMethods :: InterpreterReader m -> ImpureMethods m -- | The set of modules we will not include or whatsoever. _ignoredModules :: InterpreterReader m -> HashSet Text data ImpureMethods m ImpureMethods :: m [String] -> ([Text] -> m (Either String Text)) -> (String -> m ()) -> (MVar LuaState -> Text -> [PValue] -> m (Either String PValue)) -> ImpureMethods m _imGetCurrentCallStack :: ImpureMethods m -> m [String] _imReadFile :: ImpureMethods m -> [Text] -> m (Either String Text) _imTraceEvent :: ImpureMethods m -> String -> m () _imCallLua :: ImpureMethods m -> MVar LuaState -> Text -> [PValue] -> m (Either String PValue) data InterpreterInstr a GetNativeTypes :: InterpreterInstr (Container PuppetTypeMethods) GetStatement :: TopLevelType -> Text -> InterpreterInstr Statement ComputeTemplate :: Either Text Text -> Text -> Container ScopeInformation -> InterpreterInstr Text ExternalFunction :: Text -> [PValue] -> InterpreterInstr PValue GetNodeName :: InterpreterInstr Text HieraQuery :: Container Text -> Text -> HieraQueryType -> InterpreterInstr (Pair InterpreterWriter (Maybe PValue)) GetCurrentCallStack :: InterpreterInstr [String] IsIgnoredModule :: Text -> InterpreterInstr Bool 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 [PFactInfo] PDBGetResources :: Query ResourceField -> InterpreterInstr [Resource] PDBGetNodes :: Query NodeField -> InterpreterInstr [PNodeInfo] PDBCommitDB :: InterpreterInstr () PDBGetResourcesOfNode :: Nodename -> Query ResourceField -> InterpreterInstr [Resource] ReadFile :: [Text] -> InterpreterInstr Text TraceEvent :: String -> InterpreterInstr () CallLua :: MVar LuaState -> Text -> [PValue] -> InterpreterInstr PValue newtype Warning Warning :: Doc -> Warning type InterpreterLog = Pair Priority Doc type InterpreterWriter = [InterpreterLog] warn :: (Monad m, MonadWriter InterpreterWriter m) => Doc -> m () debug :: (Monad m, MonadWriter InterpreterWriter m) => Doc -> m () logWriter :: (Monad m, MonadWriter InterpreterWriter m) => Priority -> Doc -> m () -- | The main monad type InterpreterMonad = ProgramT InterpreterInstr (State InterpreterState) data RIdentifier RIdentifier :: !Text -> !Text -> RIdentifier _itype :: RIdentifier -> !Text _iname :: RIdentifier -> !Text data ModifierType -- | For collectors, optional resources ModifierCollector :: ModifierType -- | For stuff like realize ModifierMustMatch :: ModifierType data OverrideType -- | Overriding forbidden, will throw an error CantOverride :: OverrideType -- | Can silently replace Replace :: OverrideType -- | Silently ignore errors CantReplace :: OverrideType data ResourceCollectorType RealizeVirtual :: ResourceCollectorType RealizeCollected :: ResourceCollectorType DontRealize :: ResourceCollectorType data ResourceModifier ResourceModifier :: !Text -> !ModifierType -> !ResourceCollectorType -> !RSearchExpression -> !(Resource -> InterpreterMonad Resource) -> !PPosition -> ResourceModifier _rmResType :: ResourceModifier -> !Text _rmModifierType :: ResourceModifier -> !ModifierType _rmType :: ResourceModifier -> !ResourceCollectorType _rmSearch :: ResourceModifier -> !RSearchExpression _rmMutation :: ResourceModifier -> !(Resource -> InterpreterMonad Resource) _rmDeclaration :: ResourceModifier -> !PPosition data LinkInformation LinkInformation :: !RIdentifier -> !RIdentifier -> !LinkType -> !PPosition -> LinkInformation _linksrc :: LinkInformation -> !RIdentifier _linkdst :: LinkInformation -> !RIdentifier _linkType :: LinkInformation -> !LinkType _linkPos :: LinkInformation -> !PPosition type EdgeMap = HashMap RIdentifier [LinkInformation] -- | This is a fully resolved resource that will be used in the -- FinalCatalog. data Resource Resource :: !RIdentifier -> !(HashSet Text) -> !(Container PValue) -> !(HashMap RIdentifier (HashSet LinkType)) -> ![CurContainerDesc] -> !Virtuality -> !(HashSet Text) -> !PPosition -> !Nodename -> Resource -- | Resource name. _rid :: Resource -> !RIdentifier -- | All the resource aliases _ralias :: Resource -> !(HashSet Text) -- | Resource parameters. _rattributes :: Resource -> !(Container PValue) -- | Resource relations. _rrelations :: Resource -> !(HashMap RIdentifier (HashSet LinkType)) -- | Resource scope when it was defined, the real container will be the -- first item _rscope :: Resource -> ![CurContainerDesc] _rvirtuality :: Resource -> !Virtuality _rtags :: Resource -> !(HashSet Text) -- | Source code position of the resource definition. _rpos :: Resource -> !PPosition -- | The node were this resource was created, if remote _rnode :: Resource -> !Nodename -- | This is a function type than can be bound. It is the type of all -- subsequent validators. type PuppetTypeValidate = Resource -> Either PrettyError Resource data PuppetTypeMethods PuppetTypeMethods :: PuppetTypeValidate -> HashSet Text -> PuppetTypeMethods _puppetValidate :: PuppetTypeMethods -> PuppetTypeValidate _puppetFields :: PuppetTypeMethods -> HashSet Text type FinalCatalog = HashMap RIdentifier Resource data DaemonMethods DaemonMethods :: (Text -> Facts -> IO (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource]))) -> MStats -> MStats -> MStats -> DaemonMethods -- | The most important function, computing catalogs. Given a node name and -- a list of facts, it returns the result of the catalog compilation : -- either an error, or a tuple containing all the resources in this -- catalog, the dependency map, the exported resources, and a list of -- known resources, that might not be up to date, but are here for code -- coverage tests. _dGetCatalog :: DaemonMethods -> Text -> Facts -> IO (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource])) _dParserStats :: DaemonMethods -> MStats _dCatalogStats :: DaemonMethods -> MStats _dTemplateStats :: DaemonMethods -> MStats data PuppetEdge PuppetEdge :: RIdentifier -> RIdentifier -> LinkType -> PuppetEdge -- | Wire format, see -- http://docs.puppetlabs.com/puppetdb/1.5/api/wire_format/catalog_format.html. data WireCatalog WireCatalog :: !Nodename -> !Text -> !(Vector PuppetEdge) -> !(Vector Resource) -> !Text -> WireCatalog _wirecatalogNodename :: WireCatalog -> !Nodename _wirecatalogWVersion :: WireCatalog -> !Text _wirecatalogWEdges :: WireCatalog -> !(Vector PuppetEdge) _wirecatalogWResources :: WireCatalog -> !(Vector Resource) _wirecatalogTransactionUUID :: WireCatalog -> !Text data PFactInfo PFactInfo :: !Text -> !Text -> !PValue -> PFactInfo _pfactinfoNodename :: PFactInfo -> !Text _pfactinfoFactname :: PFactInfo -> !Text _pfactinfoFactval :: PFactInfo -> !PValue data PNodeInfo PNodeInfo :: !Nodename -> !Bool -> !(Maybe UTCTime) -> !(Maybe UTCTime) -> !(Maybe UTCTime) -> PNodeInfo _pnodeinfoNodename :: PNodeInfo -> !Nodename _pnodeinfoDeactivated :: PNodeInfo -> !Bool _pnodeinfoCatalogT :: PNodeInfo -> !(Maybe UTCTime) _pnodeinfoFactsT :: PNodeInfo -> !(Maybe UTCTime) _pnodeinfoReportT :: PNodeInfo -> !(Maybe UTCTime) data PuppetDBAPI m PuppetDBAPI :: m Doc -> (WireCatalog -> m (Either PrettyError ())) -> ([(Nodename, Facts)] -> m (Either PrettyError ())) -> (Nodename -> m (Either PrettyError ())) -> (Query FactField -> m (Either PrettyError [PFactInfo])) -> (Query ResourceField -> m (Either PrettyError [Resource])) -> (Query NodeField -> m (Either PrettyError [PNodeInfo])) -> m (Either PrettyError ()) -> (Nodename -> Query ResourceField -> m (Either PrettyError [Resource])) -> PuppetDBAPI m pdbInformation :: PuppetDBAPI m -> m Doc -- | -- http://docs.puppetlabs.com/puppetdb/1.5/api/commands.html#replace-catalog-version-3 replaceCatalog :: PuppetDBAPI m -> WireCatalog -> m (Either PrettyError ()) -- | -- http://docs.puppetlabs.com/puppetdb/1.5/api/commands.html#replace-facts-version-1 replaceFacts :: PuppetDBAPI m -> [(Nodename, Facts)] -> m (Either PrettyError ()) -- | -- http://docs.puppetlabs.com/puppetdb/1.5/api/commands.html#deactivate-node-version-1 deactivateNode :: PuppetDBAPI m -> Nodename -> m (Either PrettyError ()) -- | -- http://docs.puppetlabs.com/puppetdb/1.5/api/query/v3/facts.html#get-v3facts getFacts :: PuppetDBAPI m -> Query FactField -> m (Either PrettyError [PFactInfo]) -- | -- http://docs.puppetlabs.com/puppetdb/1.5/api/query/v3/resources.html#get-v3resources getResources :: PuppetDBAPI m -> Query ResourceField -> m (Either PrettyError [Resource]) getNodes :: PuppetDBAPI m -> Query NodeField -> m (Either PrettyError [PNodeInfo]) -- | This is only here to tell the test PuppetDB to save its content to -- disk. commitDB :: PuppetDBAPI m -> m (Either PrettyError ()) getResourcesOfNode :: PuppetDBAPI m -> Nodename -> Query ResourceField -> m (Either PrettyError [Resource]) -- | Pretty straightforward way to define the various PuppetDB queries data Query a QEqual :: a -> Text -> Query a QG :: a -> Integer -> Query a QL :: a -> Integer -> Query a QGE :: a -> Integer -> Query a QLE :: a -> Integer -> Query a QMatch :: Text -> Text -> Query a QAnd :: [Query a] -> Query a QOr :: [Query a] -> Query a QNot :: (Query a) -> Query a QEmpty :: Query a -- | Fields for the fact endpoint data FactField FName :: FactField FValue :: FactField FCertname :: FactField -- | Fields for the node endpoint data NodeField NName :: NodeField NFact :: Text -> NodeField -- | Fields for the resource endpoint data ResourceField RTag :: ResourceField RCertname :: ResourceField RParameter :: Text -> ResourceField RType :: ResourceField RTitle :: ResourceField RExported :: ResourceField RFile :: ResourceField RLine :: ResourceField class HasRIdentifier t_asDB where iname = (rIdentifier . go_asDD) where go_asDD _f_asDE (RIdentifier __itype_asDF __iname'_asDG) = ((\ __iname_asDH -> RIdentifier __itype_asDF __iname_asDH) <$> (_f_asDE __iname'_asDG)) itype = (rIdentifier . go_asDI) where go_asDI _f_asDJ (RIdentifier __itype'_asDK __iname_asDM) = ((\ __itype_asDL -> RIdentifier __itype_asDL __iname_asDM) <$> (_f_asDJ __itype'_asDK)) rIdentifier :: HasRIdentifier t_asDB => Lens' t_asDB RIdentifier iname :: HasRIdentifier t_asDB => Lens' t_asDB Text itype :: HasRIdentifier t_asDB => Lens' t_asDB Text class HasResRefOverride t_asFM where rrid = (resRefOverride . go_asFO) where go_asFO _f_asFP (ResRefOverride __rrid'_asFQ __rrparams_asFS __rrpos_asFT) = ((\ __rrid_asFR -> ResRefOverride __rrid_asFR __rrparams_asFS __rrpos_asFT) <$> (_f_asFP __rrid'_asFQ)) rrparams = (resRefOverride . go_asFU) where go_asFU _f_asFV (ResRefOverride __rrid_asFW __rrparams'_asFX __rrpos_asFZ) = ((\ __rrparams_asFY -> ResRefOverride __rrid_asFW __rrparams_asFY __rrpos_asFZ) <$> (_f_asFV __rrparams'_asFX)) rrpos = (resRefOverride . go_asG0) where go_asG0 _f_asG1 (ResRefOverride __rrid_asG2 __rrparams_asG3 __rrpos'_asG4) = ((\ __rrpos_asG5 -> ResRefOverride __rrid_asG2 __rrparams_asG3 __rrpos_asG5) <$> (_f_asG1 __rrpos'_asG4)) resRefOverride :: HasResRefOverride t_asFM => Lens' t_asFM ResRefOverride rrid :: HasResRefOverride t_asFM => Lens' t_asFM RIdentifier rrparams :: HasResRefOverride t_asFM => Lens' t_asFM (Container PValue) rrpos :: HasResRefOverride t_asFM => Lens' t_asFM PPosition class HasLinkInformation t_asHW where linkPos = (linkInformation . go_asHY) where go_asHY _f_asHZ (LinkInformation __linksrc_asI0 __linkdst_asI1 __linkType_asI2 __linkPos'_asI3) = ((\ __linkPos_asI4 -> LinkInformation __linksrc_asI0 __linkdst_asI1 __linkType_asI2 __linkPos_asI4) <$> (_f_asHZ __linkPos'_asI3)) linkType = (linkInformation . go_asI5) where go_asI5 _f_asI6 (LinkInformation __linksrc_asI7 __linkdst_asI8 __linkType'_asI9 __linkPos_asIb) = ((\ __linkType_asIa -> LinkInformation __linksrc_asI7 __linkdst_asI8 __linkType_asIa __linkPos_asIb) <$> (_f_asI6 __linkType'_asI9)) linkdst = (linkInformation . go_asIc) where go_asIc _f_asId (LinkInformation __linksrc_asIe __linkdst'_asIf __linkType_asIh __linkPos_asIi) = ((\ __linkdst_asIg -> LinkInformation __linksrc_asIe __linkdst_asIg __linkType_asIh __linkPos_asIi) <$> (_f_asId __linkdst'_asIf)) linksrc = (linkInformation . go_asIj) where go_asIj _f_asIk (LinkInformation __linksrc'_asIl __linkdst_asIn __linkType_asIo __linkPos_asIp) = ((\ __linksrc_asIm -> LinkInformation __linksrc_asIm __linkdst_asIn __linkType_asIo __linkPos_asIp) <$> (_f_asIk __linksrc'_asIl)) linkInformation :: HasLinkInformation t_asHW => Lens' t_asHW LinkInformation linkPos :: HasLinkInformation t_asHW => Lens' t_asHW PPosition linkType :: HasLinkInformation t_asHW => Lens' t_asHW LinkType linkdst :: HasLinkInformation t_asHW => Lens' t_asHW RIdentifier linksrc :: HasLinkInformation t_asHW => Lens' t_asHW RIdentifier class HasResDefaults t_asKG where defPos = (resDefaults . go_asKI) where go_asKI _f_asKJ (ResDefaults __defType_asKK __defSrcScope_asKL __defValues_asKM __defPos'_asKN) = ((\ __defPos_asKO -> ResDefaults __defType_asKK __defSrcScope_asKL __defValues_asKM __defPos_asKO) <$> (_f_asKJ __defPos'_asKN)) defSrcScope = (resDefaults . go_asKP) where go_asKP _f_asKQ (ResDefaults __defType_asKR __defSrcScope'_asKS __defValues_asKU __defPos_asKV) = ((\ __defSrcScope_asKT -> ResDefaults __defType_asKR __defSrcScope_asKT __defValues_asKU __defPos_asKV) <$> (_f_asKQ __defSrcScope'_asKS)) defType = (resDefaults . go_asKW) where go_asKW _f_asKX (ResDefaults __defType'_asKY __defSrcScope_asL0 __defValues_asL1 __defPos_asL2) = ((\ __defType_asKZ -> ResDefaults __defType_asKZ __defSrcScope_asL0 __defValues_asL1 __defPos_asL2) <$> (_f_asKX __defType'_asKY)) defValues = (resDefaults . go_asL3) where go_asL3 _f_asL4 (ResDefaults __defType_asL5 __defSrcScope_asL6 __defValues'_asL7 __defPos_asL9) = ((\ __defValues_asL8 -> ResDefaults __defType_asL5 __defSrcScope_asL6 __defValues_asL8 __defPos_asL9) <$> (_f_asL4 __defValues'_asL7)) resDefaults :: HasResDefaults t_asKG => Lens' t_asKG ResDefaults defPos :: HasResDefaults t_asKG => Lens' t_asKG PPosition defSrcScope :: HasResDefaults t_asKG => Lens' t_asKG Text defType :: HasResDefaults t_asKG => Lens' t_asKG Text defValues :: HasResDefaults t_asKG => Lens' t_asKG (Container PValue) class HasResourceModifier t_asNq where rmDeclaration = (resourceModifier . go_asNs) where go_asNs _f_asNt (ResourceModifier __rmResType_asNu __rmModifierType_asNv __rmType_asNw __rmSearch_asNx __rmMutation_asNy __rmDeclaration'_asNz) = ((\ __rmDeclaration_asNA -> ResourceModifier __rmResType_asNu __rmModifierType_asNv __rmType_asNw __rmSearch_asNx __rmMutation_asNy __rmDeclaration_asNA) <$> (_f_asNt __rmDeclaration'_asNz)) rmModifierType = (resourceModifier . go_asNB) where go_asNB _f_asNC (ResourceModifier __rmResType_asND __rmModifierType'_asNE __rmType_asNG __rmSearch_asNH __rmMutation_asNI __rmDeclaration_asNJ) = ((\ __rmModifierType_asNF -> ResourceModifier __rmResType_asND __rmModifierType_asNF __rmType_asNG __rmSearch_asNH __rmMutation_asNI __rmDeclaration_asNJ) <$> (_f_asNC __rmModifierType'_asNE)) rmMutation = (resourceModifier . go_asNK) where go_asNK _f_asNL (ResourceModifier __rmResType_asNM __rmModifierType_asNN __rmType_asNO __rmSearch_asNP __rmMutation'_asNQ __rmDeclaration_asNS) = ((\ __rmMutation_asNR -> ResourceModifier __rmResType_asNM __rmModifierType_asNN __rmType_asNO __rmSearch_asNP __rmMutation_asNR __rmDeclaration_asNS) <$> (_f_asNL __rmMutation'_asNQ)) rmResType = (resourceModifier . go_asNT) where go_asNT _f_asNU (ResourceModifier __rmResType'_asNV __rmModifierType_asNX __rmType_asNY __rmSearch_asNZ __rmMutation_asO0 __rmDeclaration_asO1) = ((\ __rmResType_asNW -> ResourceModifier __rmResType_asNW __rmModifierType_asNX __rmType_asNY __rmSearch_asNZ __rmMutation_asO0 __rmDeclaration_asO1) <$> (_f_asNU __rmResType'_asNV)) rmSearch = (resourceModifier . go_asO2) where go_asO2 _f_asO3 (ResourceModifier __rmResType_asO4 __rmModifierType_asO5 __rmType_asO6 __rmSearch'_asO7 __rmMutation_asO9 __rmDeclaration_asOa) = ((\ __rmSearch_asO8 -> ResourceModifier __rmResType_asO4 __rmModifierType_asO5 __rmType_asO6 __rmSearch_asO8 __rmMutation_asO9 __rmDeclaration_asOa) <$> (_f_asO3 __rmSearch'_asO7)) rmType = (resourceModifier . go_asOb) where go_asOb _f_asOc (ResourceModifier __rmResType_asOd __rmModifierType_asOe __rmType'_asOf __rmSearch_asOh __rmMutation_asOi __rmDeclaration_asOj) = ((\ __rmType_asOg -> ResourceModifier __rmResType_asOd __rmModifierType_asOe __rmType_asOg __rmSearch_asOh __rmMutation_asOi __rmDeclaration_asOj) <$> (_f_asOc __rmType'_asOf)) resourceModifier :: HasResourceModifier t_asNq => Lens' t_asNq ResourceModifier rmDeclaration :: HasResourceModifier t_asNq => Lens' t_asNq PPosition rmModifierType :: HasResourceModifier t_asNq => Lens' t_asNq ModifierType rmMutation :: HasResourceModifier t_asNq => Lens' t_asNq (Resource -> InterpreterMonad Resource) rmResType :: HasResourceModifier t_asNq => Lens' t_asNq Text rmSearch :: HasResourceModifier t_asNq => Lens' t_asNq RSearchExpression rmType :: HasResourceModifier t_asNq => Lens' t_asNq ResourceCollectorType class HasDaemonMethods t_asRw where dCatalogStats = (daemonMethods . go_asRy) where go_asRy _f_asRz (DaemonMethods __dGetCatalog_asRA __dParserStats_asRB __dCatalogStats'_asRC __dTemplateStats_asRE) = ((\ __dCatalogStats_asRD -> DaemonMethods __dGetCatalog_asRA __dParserStats_asRB __dCatalogStats_asRD __dTemplateStats_asRE) <$> (_f_asRz __dCatalogStats'_asRC)) dGetCatalog = (daemonMethods . go_asRF) where go_asRF _f_asRG (DaemonMethods __dGetCatalog'_asRH __dParserStats_asRJ __dCatalogStats_asRK __dTemplateStats_asRL) = ((\ __dGetCatalog_asRI -> DaemonMethods __dGetCatalog_asRI __dParserStats_asRJ __dCatalogStats_asRK __dTemplateStats_asRL) <$> (_f_asRG __dGetCatalog'_asRH)) dParserStats = (daemonMethods . go_asRM) where go_asRM _f_asRN (DaemonMethods __dGetCatalog_asRO __dParserStats'_asRP __dCatalogStats_asRR __dTemplateStats_asRS) = ((\ __dParserStats_asRQ -> DaemonMethods __dGetCatalog_asRO __dParserStats_asRQ __dCatalogStats_asRR __dTemplateStats_asRS) <$> (_f_asRN __dParserStats'_asRP)) dTemplateStats = (daemonMethods . go_asRT) where go_asRT _f_asRU (DaemonMethods __dGetCatalog_asRV __dParserStats_asRW __dCatalogStats_asRX __dTemplateStats'_asRY) = ((\ __dTemplateStats_asRZ -> DaemonMethods __dGetCatalog_asRV __dParserStats_asRW __dCatalogStats_asRX __dTemplateStats_asRZ) <$> (_f_asRU __dTemplateStats'_asRY)) daemonMethods :: HasDaemonMethods t_asRw => Lens' t_asRw DaemonMethods dCatalogStats :: HasDaemonMethods t_asRw => Lens' t_asRw MStats dGetCatalog :: HasDaemonMethods t_asRw => Lens' t_asRw (Text -> Facts -> IO (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource]))) dParserStats :: HasDaemonMethods t_asRw => Lens' t_asRw MStats dTemplateStats :: HasDaemonMethods t_asRw => Lens' t_asRw MStats class HasPuppetTypeMethods t_asUg where puppetFields = (puppetTypeMethods . go_asUi) where go_asUi _f_asUj (PuppetTypeMethods __puppetValidate_asUk __puppetFields'_asUl) = ((\ __puppetFields_asUm -> PuppetTypeMethods __puppetValidate_asUk __puppetFields_asUm) <$> (_f_asUj __puppetFields'_asUl)) puppetValidate = (puppetTypeMethods . go_asUn) where go_asUn _f_asUo (PuppetTypeMethods __puppetValidate'_asUp __puppetFields_asUr) = ((\ __puppetValidate_asUq -> PuppetTypeMethods __puppetValidate_asUq __puppetFields_asUr) <$> (_f_asUo __puppetValidate'_asUp)) puppetTypeMethods :: HasPuppetTypeMethods t_asUg => Lens' t_asUg PuppetTypeMethods puppetFields :: HasPuppetTypeMethods t_asUg => Lens' t_asUg (HashSet Text) puppetValidate :: HasPuppetTypeMethods t_asUg => Lens' t_asUg PuppetTypeValidate class HasScopeInformation t_asVM where scopeContainer = (scopeInformation . go_asVO) where go_asVO _f_asVP (ScopeInformation __scopeVariables_asVQ __scopeDefaults_asVR __scopeExtraTags_asVS __scopeContainer'_asVT __scopeOverrides_asVV __scopeParent_asVW) = ((\ __scopeContainer_asVU -> ScopeInformation __scopeVariables_asVQ __scopeDefaults_asVR __scopeExtraTags_asVS __scopeContainer_asVU __scopeOverrides_asVV __scopeParent_asVW) <$> (_f_asVP __scopeContainer'_asVT)) scopeDefaults = (scopeInformation . go_asVX) where go_asVX _f_asVY (ScopeInformation __scopeVariables_asVZ __scopeDefaults'_asW0 __scopeExtraTags_asW2 __scopeContainer_asW3 __scopeOverrides_asW4 __scopeParent_asW5) = ((\ __scopeDefaults_asW1 -> ScopeInformation __scopeVariables_asVZ __scopeDefaults_asW1 __scopeExtraTags_asW2 __scopeContainer_asW3 __scopeOverrides_asW4 __scopeParent_asW5) <$> (_f_asVY __scopeDefaults'_asW0)) scopeExtraTags = (scopeInformation . go_asW6) where go_asW6 _f_asW7 (ScopeInformation __scopeVariables_asW8 __scopeDefaults_asW9 __scopeExtraTags'_asWa __scopeContainer_asWc __scopeOverrides_asWd __scopeParent_asWe) = ((\ __scopeExtraTags_asWb -> ScopeInformation __scopeVariables_asW8 __scopeDefaults_asW9 __scopeExtraTags_asWb __scopeContainer_asWc __scopeOverrides_asWd __scopeParent_asWe) <$> (_f_asW7 __scopeExtraTags'_asWa)) scopeOverrides = (scopeInformation . go_asWf) where go_asWf _f_asWg (ScopeInformation __scopeVariables_asWh __scopeDefaults_asWi __scopeExtraTags_asWj __scopeContainer_asWk __scopeOverrides'_asWl __scopeParent_asWn) = ((\ __scopeOverrides_asWm -> ScopeInformation __scopeVariables_asWh __scopeDefaults_asWi __scopeExtraTags_asWj __scopeContainer_asWk __scopeOverrides_asWm __scopeParent_asWn) <$> (_f_asWg __scopeOverrides'_asWl)) scopeParent = (scopeInformation . go_asWo) where go_asWo _f_asWp (ScopeInformation __scopeVariables_asWq __scopeDefaults_asWr __scopeExtraTags_asWs __scopeContainer_asWt __scopeOverrides_asWu __scopeParent'_asWv) = ((\ __scopeParent_asWw -> ScopeInformation __scopeVariables_asWq __scopeDefaults_asWr __scopeExtraTags_asWs __scopeContainer_asWt __scopeOverrides_asWu __scopeParent_asWw) <$> (_f_asWp __scopeParent'_asWv)) scopeVariables = (scopeInformation . go_asWx) where go_asWx _f_asWy (ScopeInformation __scopeVariables'_asWz __scopeDefaults_asWB __scopeExtraTags_asWC __scopeContainer_asWD __scopeOverrides_asWE __scopeParent_asWF) = ((\ __scopeVariables_asWA -> ScopeInformation __scopeVariables_asWA __scopeDefaults_asWB __scopeExtraTags_asWC __scopeContainer_asWD __scopeOverrides_asWE __scopeParent_asWF) <$> (_f_asWy __scopeVariables'_asWz)) scopeInformation :: HasScopeInformation t_asVM => Lens' t_asVM ScopeInformation scopeContainer :: HasScopeInformation t_asVM => Lens' t_asVM CurContainer scopeDefaults :: HasScopeInformation t_asVM => Lens' t_asVM (Container ResDefaults) scopeExtraTags :: HasScopeInformation t_asVM => Lens' t_asVM (HashSet Text) scopeOverrides :: HasScopeInformation t_asVM => Lens' t_asVM (HashMap RIdentifier ResRefOverride) scopeParent :: HasScopeInformation t_asVM => Lens' t_asVM (Maybe Text) scopeVariables :: HasScopeInformation t_asVM => Lens' t_asVM (Container (Pair (Pair PValue PPosition) CurContainerDesc)) class HasResource t_asZS where ralias = (resource . go_asZU) where go_asZU _f_asZV (Resource __rid_asZW __ralias'_asZX __rattributes_asZZ __rrelations_at00 __rscope_at01 __rvirtuality_at02 __rtags_at03 __rpos_at04 __rnode_at05) = ((\ __ralias_asZY -> Resource __rid_asZW __ralias_asZY __rattributes_asZZ __rrelations_at00 __rscope_at01 __rvirtuality_at02 __rtags_at03 __rpos_at04 __rnode_at05) <$> (_f_asZV __ralias'_asZX)) rattributes = (resource . go_at06) where go_at06 _f_at07 (Resource __rid_at08 __ralias_at09 __rattributes'_at0a __rrelations_at0c __rscope_at0d __rvirtuality_at0e __rtags_at0f __rpos_at0g __rnode_at0h) = ((\ __rattributes_at0b -> Resource __rid_at08 __ralias_at09 __rattributes_at0b __rrelations_at0c __rscope_at0d __rvirtuality_at0e __rtags_at0f __rpos_at0g __rnode_at0h) <$> (_f_at07 __rattributes'_at0a)) rid = (resource . go_at0i) where go_at0i _f_at0j (Resource __rid'_at0k __ralias_at0m __rattributes_at0n __rrelations_at0o __rscope_at0p __rvirtuality_at0q __rtags_at0r __rpos_at0s __rnode_at0t) = ((\ __rid_at0l -> Resource __rid_at0l __ralias_at0m __rattributes_at0n __rrelations_at0o __rscope_at0p __rvirtuality_at0q __rtags_at0r __rpos_at0s __rnode_at0t) <$> (_f_at0j __rid'_at0k)) rnode = (resource . go_at0u) where go_at0u _f_at0v (Resource __rid_at0w __ralias_at0x __rattributes_at0y __rrelations_at0z __rscope_at0A __rvirtuality_at0B __rtags_at0C __rpos_at0D __rnode'_at0E) = ((\ __rnode_at0F -> Resource __rid_at0w __ralias_at0x __rattributes_at0y __rrelations_at0z __rscope_at0A __rvirtuality_at0B __rtags_at0C __rpos_at0D __rnode_at0F) <$> (_f_at0v __rnode'_at0E)) rpos = (resource . go_at0G) where go_at0G _f_at0H (Resource __rid_at0I __ralias_at0J __rattributes_at0K __rrelations_at0L __rscope_at0M __rvirtuality_at0N __rtags_at0O __rpos'_at0P __rnode_at0R) = ((\ __rpos_at0Q -> Resource __rid_at0I __ralias_at0J __rattributes_at0K __rrelations_at0L __rscope_at0M __rvirtuality_at0N __rtags_at0O __rpos_at0Q __rnode_at0R) <$> (_f_at0H __rpos'_at0P)) rrelations = (resource . go_at0S) where go_at0S _f_at0T (Resource __rid_at0U __ralias_at0V __rattributes_at0W __rrelations'_at0X __rscope_at0Z __rvirtuality_at10 __rtags_at11 __rpos_at12 __rnode_at13) = ((\ __rrelations_at0Y -> Resource __rid_at0U __ralias_at0V __rattributes_at0W __rrelations_at0Y __rscope_at0Z __rvirtuality_at10 __rtags_at11 __rpos_at12 __rnode_at13) <$> (_f_at0T __rrelations'_at0X)) rscope = (resource . go_at14) where go_at14 _f_at15 (Resource __rid_at16 __ralias_at17 __rattributes_at18 __rrelations_at19 __rscope'_at1a __rvirtuality_at1c __rtags_at1d __rpos_at1e __rnode_at1f) = ((\ __rscope_at1b -> Resource __rid_at16 __ralias_at17 __rattributes_at18 __rrelations_at19 __rscope_at1b __rvirtuality_at1c __rtags_at1d __rpos_at1e __rnode_at1f) <$> (_f_at15 __rscope'_at1a)) rtags = (resource . go_at1g) where go_at1g _f_at1h (Resource __rid_at1i __ralias_at1j __rattributes_at1k __rrelations_at1l __rscope_at1m __rvirtuality_at1n __rtags'_at1o __rpos_at1q __rnode_at1r) = ((\ __rtags_at1p -> Resource __rid_at1i __ralias_at1j __rattributes_at1k __rrelations_at1l __rscope_at1m __rvirtuality_at1n __rtags_at1p __rpos_at1q __rnode_at1r) <$> (_f_at1h __rtags'_at1o)) rvirtuality = (resource . go_at1s) where go_at1s _f_at1t (Resource __rid_at1u __ralias_at1v __rattributes_at1w __rrelations_at1x __rscope_at1y __rvirtuality'_at1z __rtags_at1B __rpos_at1C __rnode_at1D) = ((\ __rvirtuality_at1A -> Resource __rid_at1u __ralias_at1v __rattributes_at1w __rrelations_at1x __rscope_at1y __rvirtuality_at1A __rtags_at1B __rpos_at1C __rnode_at1D) <$> (_f_at1t __rvirtuality'_at1z)) resource :: HasResource t_asZS => Lens' t_asZS Resource ralias :: HasResource t_asZS => Lens' t_asZS (HashSet Text) rattributes :: HasResource t_asZS => Lens' t_asZS (Container PValue) rid :: HasResource t_asZS => Lens' t_asZS RIdentifier rnode :: HasResource t_asZS => Lens' t_asZS Nodename rpos :: HasResource t_asZS => Lens' t_asZS PPosition rrelations :: HasResource t_asZS => Lens' t_asZS (HashMap RIdentifier (HashSet LinkType)) rscope :: HasResource t_asZS => Lens' t_asZS [CurContainerDesc] rtags :: HasResource t_asZS => Lens' t_asZS (HashSet Text) rvirtuality :: HasResource t_asZS => Lens' t_asZS Virtuality class HasInterpreterState t_at6f where curPos = (interpreterState . go_at6h) where go_at6h _f_at6i (InterpreterState __scopes_at6j __loadedClasses_at6k __definedResources_at6l __curScope_at6m __curPos'_at6n __nestedDeclarations_at6p __extraRelations_at6q __resMod_at6r) = ((\ __curPos_at6o -> InterpreterState __scopes_at6j __loadedClasses_at6k __definedResources_at6l __curScope_at6m __curPos_at6o __nestedDeclarations_at6p __extraRelations_at6q __resMod_at6r) <$> (_f_at6i __curPos'_at6n)) curScope = (interpreterState . go_at6s) where go_at6s _f_at6t (InterpreterState __scopes_at6u __loadedClasses_at6v __definedResources_at6w __curScope'_at6x __curPos_at6z __nestedDeclarations_at6A __extraRelations_at6B __resMod_at6C) = ((\ __curScope_at6y -> InterpreterState __scopes_at6u __loadedClasses_at6v __definedResources_at6w __curScope_at6y __curPos_at6z __nestedDeclarations_at6A __extraRelations_at6B __resMod_at6C) <$> (_f_at6t __curScope'_at6x)) definedResources = (interpreterState . go_at6D) where go_at6D _f_at6E (InterpreterState __scopes_at6F __loadedClasses_at6G __definedResources'_at6H __curScope_at6J __curPos_at6K __nestedDeclarations_at6L __extraRelations_at6M __resMod_at6N) = ((\ __definedResources_at6I -> InterpreterState __scopes_at6F __loadedClasses_at6G __definedResources_at6I __curScope_at6J __curPos_at6K __nestedDeclarations_at6L __extraRelations_at6M __resMod_at6N) <$> (_f_at6E __definedResources'_at6H)) extraRelations = (interpreterState . go_at6O) where go_at6O _f_at6P (InterpreterState __scopes_at6Q __loadedClasses_at6R __definedResources_at6S __curScope_at6T __curPos_at6U __nestedDeclarations_at6V __extraRelations'_at6W __resMod_at6Y) = ((\ __extraRelations_at6X -> InterpreterState __scopes_at6Q __loadedClasses_at6R __definedResources_at6S __curScope_at6T __curPos_at6U __nestedDeclarations_at6V __extraRelations_at6X __resMod_at6Y) <$> (_f_at6P __extraRelations'_at6W)) loadedClasses = (interpreterState . go_at6Z) where go_at6Z _f_at70 (InterpreterState __scopes_at71 __loadedClasses'_at72 __definedResources_at74 __curScope_at75 __curPos_at76 __nestedDeclarations_at77 __extraRelations_at78 __resMod_at79) = ((\ __loadedClasses_at73 -> InterpreterState __scopes_at71 __loadedClasses_at73 __definedResources_at74 __curScope_at75 __curPos_at76 __nestedDeclarations_at77 __extraRelations_at78 __resMod_at79) <$> (_f_at70 __loadedClasses'_at72)) nestedDeclarations = (interpreterState . go_at7a) where go_at7a _f_at7b (InterpreterState __scopes_at7c __loadedClasses_at7d __definedResources_at7e __curScope_at7f __curPos_at7g __nestedDeclarations'_at7h __extraRelations_at7j __resMod_at7k) = ((\ __nestedDeclarations_at7i -> InterpreterState __scopes_at7c __loadedClasses_at7d __definedResources_at7e __curScope_at7f __curPos_at7g __nestedDeclarations_at7i __extraRelations_at7j __resMod_at7k) <$> (_f_at7b __nestedDeclarations'_at7h)) resMod = (interpreterState . go_at7l) where go_at7l _f_at7m (InterpreterState __scopes_at7n __loadedClasses_at7o __definedResources_at7p __curScope_at7q __curPos_at7r __nestedDeclarations_at7s __extraRelations_at7t __resMod'_at7u) = ((\ __resMod_at7v -> InterpreterState __scopes_at7n __loadedClasses_at7o __definedResources_at7p __curScope_at7q __curPos_at7r __nestedDeclarations_at7s __extraRelations_at7t __resMod_at7v) <$> (_f_at7m __resMod'_at7u)) scopes = (interpreterState . go_at7w) where go_at7w _f_at7x (InterpreterState __scopes'_at7y __loadedClasses_at7A __definedResources_at7B __curScope_at7C __curPos_at7D __nestedDeclarations_at7E __extraRelations_at7F __resMod_at7G) = ((\ __scopes_at7z -> InterpreterState __scopes_at7z __loadedClasses_at7A __definedResources_at7B __curScope_at7C __curPos_at7D __nestedDeclarations_at7E __extraRelations_at7F __resMod_at7G) <$> (_f_at7x __scopes'_at7y)) interpreterState :: HasInterpreterState t_at6f => Lens' t_at6f InterpreterState curPos :: HasInterpreterState t_at6f => Lens' t_at6f PPosition curScope :: HasInterpreterState t_at6f => Lens' t_at6f [CurContainerDesc] definedResources :: HasInterpreterState t_at6f => Lens' t_at6f (HashMap RIdentifier Resource) extraRelations :: HasInterpreterState t_at6f => Lens' t_at6f [LinkInformation] loadedClasses :: HasInterpreterState t_at6f => Lens' t_at6f (Container (Pair ClassIncludeType PPosition)) nestedDeclarations :: HasInterpreterState t_at6f => Lens' t_at6f (HashMap (TopLevelType, Text) Statement) resMod :: HasInterpreterState t_at6f => Lens' t_at6f [ResourceModifier] scopes :: HasInterpreterState t_at6f => Lens' t_at6f (Container ScopeInformation) class HasInterpreterReader t_atbP m_as6h | t_atbP -> m_as6h where computeTemplateFunction = (interpreterReader . go_atbR) where go_atbR _f_atbS (InterpreterReader __nativeTypes_atbT __getStatement_atbU __computeTemplateFunction'_atbV __pdbAPI_atbX __externalFunctions_atbY __thisNodename_atbZ __hieraQuery_atc0 __ioMethods_atc1 __ignoredModules_atc2) = ((\ __computeTemplateFunction_atbW -> InterpreterReader __nativeTypes_atbT __getStatement_atbU __computeTemplateFunction_atbW __pdbAPI_atbX __externalFunctions_atbY __thisNodename_atbZ __hieraQuery_atc0 __ioMethods_atc1 __ignoredModules_atc2) <$> (_f_atbS __computeTemplateFunction'_atbV)) externalFunctions = (interpreterReader . go_atc3) where go_atc3 _f_atc4 (InterpreterReader __nativeTypes_atc5 __getStatement_atc6 __computeTemplateFunction_atc7 __pdbAPI_atc8 __externalFunctions'_atc9 __thisNodename_atcb __hieraQuery_atcc __ioMethods_atcd __ignoredModules_atce) = ((\ __externalFunctions_atca -> InterpreterReader __nativeTypes_atc5 __getStatement_atc6 __computeTemplateFunction_atc7 __pdbAPI_atc8 __externalFunctions_atca __thisNodename_atcb __hieraQuery_atcc __ioMethods_atcd __ignoredModules_atce) <$> (_f_atc4 __externalFunctions'_atc9)) getStatement = (interpreterReader . go_atcf) where go_atcf _f_atcg (InterpreterReader __nativeTypes_atch __getStatement'_atci __computeTemplateFunction_atck __pdbAPI_atcl __externalFunctions_atcm __thisNodename_atcn __hieraQuery_atco __ioMethods_atcp __ignoredModules_atcq) = ((\ __getStatement_atcj -> InterpreterReader __nativeTypes_atch __getStatement_atcj __computeTemplateFunction_atck __pdbAPI_atcl __externalFunctions_atcm __thisNodename_atcn __hieraQuery_atco __ioMethods_atcp __ignoredModules_atcq) <$> (_f_atcg __getStatement'_atci)) hieraQuery = (interpreterReader . go_atcr) where go_atcr _f_atcs (InterpreterReader __nativeTypes_atct __getStatement_atcu __computeTemplateFunction_atcv __pdbAPI_atcw __externalFunctions_atcx __thisNodename_atcy __hieraQuery'_atcz __ioMethods_atcB __ignoredModules_atcC) = ((\ __hieraQuery_atcA -> InterpreterReader __nativeTypes_atct __getStatement_atcu __computeTemplateFunction_atcv __pdbAPI_atcw __externalFunctions_atcx __thisNodename_atcy __hieraQuery_atcA __ioMethods_atcB __ignoredModules_atcC) <$> (_f_atcs __hieraQuery'_atcz)) ignoredModules = (interpreterReader . go_atcD) where go_atcD _f_atcE (InterpreterReader __nativeTypes_atcF __getStatement_atcG __computeTemplateFunction_atcH __pdbAPI_atcI __externalFunctions_atcJ __thisNodename_atcK __hieraQuery_atcL __ioMethods_atcM __ignoredModules'_atcN) = ((\ __ignoredModules_atcO -> InterpreterReader __nativeTypes_atcF __getStatement_atcG __computeTemplateFunction_atcH __pdbAPI_atcI __externalFunctions_atcJ __thisNodename_atcK __hieraQuery_atcL __ioMethods_atcM __ignoredModules_atcO) <$> (_f_atcE __ignoredModules'_atcN)) ioMethods = (interpreterReader . go_atcP) where go_atcP _f_atcQ (InterpreterReader __nativeTypes_atcR __getStatement_atcS __computeTemplateFunction_atcT __pdbAPI_atcU __externalFunctions_atcV __thisNodename_atcW __hieraQuery_atcX __ioMethods'_atcY __ignoredModules_atd0) = ((\ __ioMethods_atcZ -> InterpreterReader __nativeTypes_atcR __getStatement_atcS __computeTemplateFunction_atcT __pdbAPI_atcU __externalFunctions_atcV __thisNodename_atcW __hieraQuery_atcX __ioMethods_atcZ __ignoredModules_atd0) <$> (_f_atcQ __ioMethods'_atcY)) nativeTypes = (interpreterReader . go_atd1) where go_atd1 _f_atd2 (InterpreterReader __nativeTypes'_atd3 __getStatement_atd5 __computeTemplateFunction_atd6 __pdbAPI_atd7 __externalFunctions_atd8 __thisNodename_atd9 __hieraQuery_atda __ioMethods_atdb __ignoredModules_atdc) = ((\ __nativeTypes_atd4 -> InterpreterReader __nativeTypes_atd4 __getStatement_atd5 __computeTemplateFunction_atd6 __pdbAPI_atd7 __externalFunctions_atd8 __thisNodename_atd9 __hieraQuery_atda __ioMethods_atdb __ignoredModules_atdc) <$> (_f_atd2 __nativeTypes'_atd3)) pdbAPI = (interpreterReader . go_atdd) where go_atdd _f_atde (InterpreterReader __nativeTypes_atdf __getStatement_atdg __computeTemplateFunction_atdh __pdbAPI'_atdi __externalFunctions_atdk __thisNodename_atdl __hieraQuery_atdm __ioMethods_atdn __ignoredModules_atdo) = ((\ __pdbAPI_atdj -> InterpreterReader __nativeTypes_atdf __getStatement_atdg __computeTemplateFunction_atdh __pdbAPI_atdj __externalFunctions_atdk __thisNodename_atdl __hieraQuery_atdm __ioMethods_atdn __ignoredModules_atdo) <$> (_f_atde __pdbAPI'_atdi)) thisNodename = (interpreterReader . go_atdp) where go_atdp _f_atdq (InterpreterReader __nativeTypes_atdr __getStatement_atds __computeTemplateFunction_atdt __pdbAPI_atdu __externalFunctions_atdv __thisNodename'_atdw __hieraQuery_atdy __ioMethods_atdz __ignoredModules_atdA) = ((\ __thisNodename_atdx -> InterpreterReader __nativeTypes_atdr __getStatement_atds __computeTemplateFunction_atdt __pdbAPI_atdu __externalFunctions_atdv __thisNodename_atdx __hieraQuery_atdy __ioMethods_atdz __ignoredModules_atdA) <$> (_f_atdq __thisNodename'_atdw)) interpreterReader :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP (InterpreterReader m_as6h) computeTemplateFunction :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP (Either Text Text -> Text -> Container ScopeInformation -> m_as6h (Either PrettyError Text)) externalFunctions :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP (Container ([PValue] -> InterpreterMonad PValue)) getStatement :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP (TopLevelType -> Text -> m_as6h (Either PrettyError Statement)) hieraQuery :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP (HieraQueryFunc m_as6h) ignoredModules :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP (HashSet Text) ioMethods :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP (ImpureMethods m_as6h) nativeTypes :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP (Container PuppetTypeMethods) pdbAPI :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP (PuppetDBAPI m_as6h) thisNodename :: HasInterpreterReader t_atbP m_as6h => Lens' t_atbP Text class HasImpureMethods t_ativ m_as6g | t_ativ -> m_as6g where imCallLua = (impureMethods . go_atix) where go_atix _f_atiy (ImpureMethods __imGetCurrentCallStack_atiz __imReadFile_atiA __imTraceEvent_atiB __imCallLua'_atiC) = ((\ __imCallLua_atiD -> ImpureMethods __imGetCurrentCallStack_atiz __imReadFile_atiA __imTraceEvent_atiB __imCallLua_atiD) <$> (_f_atiy __imCallLua'_atiC)) imGetCurrentCallStack = (impureMethods . go_atiE) where go_atiE _f_atiF (ImpureMethods __imGetCurrentCallStack'_atiG __imReadFile_atiI __imTraceEvent_atiJ __imCallLua_atiK) = ((\ __imGetCurrentCallStack_atiH -> ImpureMethods __imGetCurrentCallStack_atiH __imReadFile_atiI __imTraceEvent_atiJ __imCallLua_atiK) <$> (_f_atiF __imGetCurrentCallStack'_atiG)) imReadFile = (impureMethods . go_atiL) where go_atiL _f_atiM (ImpureMethods __imGetCurrentCallStack_atiN __imReadFile'_atiO __imTraceEvent_atiQ __imCallLua_atiR) = ((\ __imReadFile_atiP -> ImpureMethods __imGetCurrentCallStack_atiN __imReadFile_atiP __imTraceEvent_atiQ __imCallLua_atiR) <$> (_f_atiM __imReadFile'_atiO)) imTraceEvent = (impureMethods . go_atiS) where go_atiS _f_atiT (ImpureMethods __imGetCurrentCallStack_atiU __imReadFile_atiV __imTraceEvent'_atiW __imCallLua_atiY) = ((\ __imTraceEvent_atiX -> ImpureMethods __imGetCurrentCallStack_atiU __imReadFile_atiV __imTraceEvent_atiX __imCallLua_atiY) <$> (_f_atiT __imTraceEvent'_atiW)) impureMethods :: HasImpureMethods t_ativ m_as6g => Lens' t_ativ (ImpureMethods m_as6g) imCallLua :: HasImpureMethods t_ativ m_as6g => Lens' t_ativ (MVar LuaState -> Text -> [PValue] -> m_as6g (Either String PValue)) imGetCurrentCallStack :: HasImpureMethods t_ativ m_as6g => Lens' t_ativ (m_as6g [String]) imReadFile :: HasImpureMethods t_ativ m_as6g => Lens' t_ativ ([Text] -> m_as6g (Either String Text)) imTraceEvent :: HasImpureMethods t_ativ m_as6g => Lens' t_ativ (String -> m_as6g ()) class HasCurContainer t_atlo where cctags = (curContainer . go_atlq) where go_atlq _f_atlr (CurContainer __cctype_atls __cctags'_atlt) = ((\ __cctags_atlu -> CurContainer __cctype_atls __cctags_atlu) <$> (_f_atlr __cctags'_atlt)) cctype = (curContainer . go_atlv) where go_atlv _f_atlw (CurContainer __cctype'_atlx __cctags_atlz) = ((\ __cctype_atly -> CurContainer __cctype_atly __cctags_atlz) <$> (_f_atlw __cctype'_atlx)) curContainer :: HasCurContainer t_atlo => Lens' t_atlo CurContainer cctags :: HasCurContainer t_atlo => Lens' t_atlo (HashSet Text) cctype :: HasCurContainer t_atlo => Lens' t_atlo CurContainerDesc class HasNodename c_atnv e_atnw | c_atnv -> e_atnw nodename :: HasNodename c_atnv e_atnw => Lens' c_atnv e_atnw class HasWVersion c_atnv e_atnw | c_atnv -> e_atnw wVersion :: HasWVersion c_atnv e_atnw => Lens' c_atnv e_atnw class HasWEdges c_atnv e_atnw | c_atnv -> e_atnw wEdges :: HasWEdges c_atnv e_atnw => Lens' c_atnv e_atnw class HasWResources c_atnv e_atnw | c_atnv -> e_atnw wResources :: HasWResources c_atnv e_atnw => Lens' c_atnv e_atnw class HasTransactionUUID c_atnv e_atnw | c_atnv -> e_atnw transactionUUID :: HasTransactionUUID c_atnv e_atnw => Lens' c_atnv e_atnw _wirecatalogWVersionLens :: Lens' WireCatalog Text _wirecatalogWResourcesLens :: Lens' WireCatalog (Vector Resource) _wirecatalogWEdgesLens :: Lens' WireCatalog (Vector PuppetEdge) _wirecatalogTransactionUUIDLens :: Lens' WireCatalog Text _wirecatalogNodenameLens :: Lens' WireCatalog Nodename class HasFactname c_atpC e_atpD | c_atpC -> e_atpD factname :: HasFactname c_atpC e_atpD => Lens' c_atpC e_atpD class HasFactval c_atpC e_atpD | c_atpC -> e_atpD factval :: HasFactval c_atpC e_atpD => Lens' c_atpC e_atpD _pfactinfoNodenameLens :: Lens' PFactInfo Text _pfactinfoFactvalLens :: Lens' PFactInfo PValue _pfactinfoFactnameLens :: Lens' PFactInfo Text class HasDeactivated c_atri e_atrj | c_atri -> e_atrj deactivated :: HasDeactivated c_atri e_atrj => Lens' c_atri e_atrj class HasCatalogT c_atri e_atrj | c_atri -> e_atrj catalogT :: HasCatalogT c_atri e_atrj => Lens' c_atri e_atrj class HasFactsT c_atri e_atrj | c_atri -> e_atrj factsT :: HasFactsT c_atri e_atrj => Lens' c_atri e_atrj class HasReportT c_atri e_atrj | c_atri -> e_atrj reportT :: HasReportT c_atri e_atrj => Lens' c_atri e_atrj _pnodeinfoReportTLens :: Lens' PNodeInfo (Maybe UTCTime) _pnodeinfoNodenameLens :: Lens' PNodeInfo Nodename _pnodeinfoFactsTLens :: Lens' PNodeInfo (Maybe UTCTime) _pnodeinfoDeactivatedLens :: Lens' PNodeInfo Bool _pnodeinfoCatalogTLens :: Lens' PNodeInfo (Maybe UTCTime) rcurcontainer :: Resource -> CurContainerDesc class MonadThrowPos m throwPosError :: MonadThrowPos m => Doc -> m a class MonadStack m getCallStack :: MonadStack m => m [String] tpe :: (MonadStack m, MonadError PrettyError m, MonadState InterpreterState m) => Doc -> m b getCurContainer :: InterpreterMonad CurContainer scopeName :: CurContainerDesc -> Text getScopeName :: InterpreterMonad Text getScope :: InterpreterMonad CurContainerDesc eitherDocIO :: IO (Either PrettyError a) -> IO (Either PrettyError a) interpreterIO :: (MonadThrowPos m, MonadIO m) => IO (Either PrettyError a) -> m a mightFail :: (MonadError PrettyError m, MonadThrowPos m) => m (Either PrettyError a) -> m a safeDecodeUtf8 :: ByteString -> InterpreterMonad Text interpreterError :: InterpreterMonad (Either PrettyError a) -> InterpreterMonad a resourceRelations :: Resource -> [(RIdentifier, LinkType)] -- | helper for hashmap, in case we want another kind of map .. ifromList :: (Monoid m, At m, Foldable f) => f (Index m, IxValue m) -> m ikeys :: (Eq k, Hashable k) => HashMap k v -> HashSet k isingleton :: (Monoid b, At b) => Index b -> IxValue b -> b ifromListWith :: (Monoid m, At m, Foldable f) => (IxValue m -> IxValue m -> IxValue m) -> f (Index m, IxValue m) -> m iinsertWith :: At m => (IxValue m -> IxValue m -> IxValue m) -> Index m -> IxValue m -> m -> m iunionWith :: (Hashable k, Eq k) => (v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v fnull :: (Eq x, Monoid x) => x -> Bool rid2text :: RIdentifier -> Text text2Scientific :: Text -> Maybe Scientific initialState :: Facts -> InterpreterState dummypos :: PPosition instance AsNumber PValue instance FromJSON PNodeInfo instance ToJSON PNodeInfo instance FromJSON PFactInfo instance ToJSON PFactInfo instance ToJSON WireCatalog instance FromJSON WireCatalog instance ToJSON PuppetEdge instance FromJSON PuppetEdge instance ToJSON RIdentifier instance FromJSON RIdentifier instance FromJSON ResourceField instance ToJSON ResourceField instance FromJSON NodeField instance ToJSON NodeField instance FromJSON FactField instance ToJSON FactField instance FromJSON a => FromJSON (Query a) instance ToJSON a => ToJSON (Query a) instance FromJSON Resource instance ToJSON Resource instance FromRuby PValue instance ToRuby PValue instance ToJSON PValue instance FromJSON PValue instance MonadThrowPos InterpreterMonad instance MonadStack InterpreterMonad instance HasReportT PNodeInfo (Maybe UTCTime) instance HasFactsT PNodeInfo (Maybe UTCTime) instance HasCatalogT PNodeInfo (Maybe UTCTime) instance HasDeactivated PNodeInfo Bool instance HasNodename PNodeInfo Nodename instance HasFactval PFactInfo PValue instance HasFactname PFactInfo Text instance HasNodename PFactInfo Text instance HasTransactionUUID WireCatalog Text instance HasWResources WireCatalog (Vector Resource) instance HasWEdges WireCatalog (Vector PuppetEdge) instance HasWVersion WireCatalog Text instance HasNodename WireCatalog Nodename instance HasCurContainer CurContainer instance HasImpureMethods (ImpureMethods m0) m0 instance HasInterpreterReader (InterpreterReader m0) m0 instance HasInterpreterState InterpreterState instance HasResource Resource instance HasScopeInformation ScopeInformation instance HasPuppetTypeMethods PuppetTypeMethods instance HasDaemonMethods DaemonMethods instance HasResourceModifier ResourceModifier instance HasResDefaults ResDefaults instance HasLinkInformation LinkInformation instance HasResRefOverride ResRefOverride instance HasRIdentifier RIdentifier instance Eq PValue instance Show PValue instance Eq RSearchExpression instance Eq ClassIncludeType instance Generic TopLevelType instance Eq TopLevelType instance Eq CurContainerDesc instance Generic CurContainerDesc instance Ord CurContainerDesc instance Eq CurContainer instance Show RIdentifier instance Eq RIdentifier instance Generic RIdentifier instance Ord RIdentifier instance Eq ResRefOverride instance Eq ModifierType instance Eq ResourceCollectorType instance Eq Resource instance Datatype D1TopLevelType instance Constructor C1_0TopLevelType instance Constructor C1_1TopLevelType instance Constructor C1_2TopLevelType instance Constructor C1_3TopLevelType instance Datatype D1CurContainerDesc instance Constructor C1_0CurContainerDesc instance Constructor C1_1CurContainerDesc instance Constructor C1_2CurContainerDesc instance Constructor C1_3CurContainerDesc instance Constructor C1_4CurContainerDesc instance Datatype D1RIdentifier instance Constructor C1_0RIdentifier instance Selector S1_0_0RIdentifier instance Selector S1_0_1RIdentifier instance Hashable RIdentifier instance Error PrettyError instance MonadWriter InterpreterWriter InterpreterMonad instance MonadError PrettyError InterpreterMonad instance Hashable TopLevelType instance IsString PValue instance IsString PrettyError instance Show PrettyError -- | A dummy implementation of PuppetDBAPI, that will return empty -- responses. module PuppetDB.Dummy dummyPuppetDB :: Monad m => PuppetDBAPI m -- | This module runs a Hiera server that caches Hiera data. There is a -- huge caveat : only the data files are watched for changes, not the -- main configuration file. -- -- A minor bug is that interpolation will not work for inputs containing -- the % character when it isn't used for interpolation. module Hiera.Server -- | The only method you'll ever need. It runs a Hiera server and gives you -- a querying function. The Nil output is explicitely given as a -- Maybe type. startHiera :: FilePath -> IO (Either String (HieraQueryFunc IO)) -- | A dummy hiera function that will be used when hiera is not detected dummyHiera :: Monad m => HieraQueryFunc m -- | The type of the Hiera API function type HieraQueryFunc m = Container Text -> Text -> HieraQueryType -> m (Either PrettyError (Pair InterpreterWriter (Maybe PValue))) instance FromJSON HieraConfig instance FromJSON InterpolableHieraString instance HasBasedir HieraConfig FilePath instance HasHierarchy HieraConfig [InterpolableHieraString] instance HasBackends HieraConfig [HieraBackend] instance Show HieraBackend instance Show HieraStringPart instance Show InterpolableHieraString instance Show HieraConfig instance Pretty HieraStringPart module Facter storageunits :: [(String, Int)] getPrefix :: Int -> String getOrder :: String -> Int normalizeUnit :: (Double, Int) -> Double -> (Double, Int) storagedesc :: (String, String) -> String factRAM :: IO [(String, String)] factNET :: IO [(String, String)] factOS :: IO [(String, String)] factOSDebian :: IO [(String, String)] factOSLSB :: IO [(String, String)] factMountPoints :: IO [(String, String)] fversion :: IO [(String, String)] factUser :: IO [(String, String)] factUName :: IO [(String, String)] fenv :: IO [(String, String)] factProcessor :: IO [(String, String)] puppetDBFacts :: Text -> PuppetDBAPI IO -> IO (Container PValue) module PuppetDB.Remote -- | Given an URL (ie. http:localhost:8080), will return an -- incomplete PuppetDBAPI. pdbConnect :: Text -> IO (Either PrettyError (PuppetDBAPI IO)) module Puppet.Interpreter.PrettyPrinter containerComma :: Pretty a => Container a -> Doc instance Pretty LinkInformation instance Pretty (InterpreterInstr a) instance Pretty RSearchExpression instance Pretty ResourceModifier instance Pretty ResDefaults instance Pretty CurContainerDesc instance Pretty Resource instance Pretty RIdentifier instance Pretty TopLevelType instance Pretty PValue -- | These are the function and data types that are used to define the -- Puppet native types. module Puppet.NativeTypes.Helpers ipaddr :: Text -> PuppetTypeValidate paramname :: Text -> Doc rarray :: Text -> PuppetTypeValidate -- | This checks that a given parameter is a string. If it is a -- ResolvedInt or ResolvedBool it will convert them to -- strings. string :: Text -> PuppetTypeValidate strings :: Text -> PuppetTypeValidate noTrailingSlash :: Text -> PuppetTypeValidate fullyQualified :: Text -> PuppetTypeValidate fullyQualifieds :: Text -> PuppetTypeValidate -- | Makes sure that the parameter, if defined, has a value among this -- list. values :: [Text] -> Text -> PuppetTypeValidate -- | This fills the default values of unset parameters. defaultvalue :: Text -> Text -> PuppetTypeValidate -- | Copies the name value into the parameter if this is not set. It -- implies the string validator. nameval :: Text -> PuppetTypeValidate -- | This helper will validate resources given a list of fields. It will -- run checkParameterList and then addDefaults. defaultValidate :: HashSet Text -> PuppetTypeValidate type PuppetTypeName = Text -- | Helper that takes a list of stuff and will generate a validator. parameterFunctions :: [(Text, [Text -> PuppetTypeValidate])] -> PuppetTypeValidate -- | Checks that a given parameter, if set, is a ResolvedInt. If -- it is a PString it will attempt to parse it. integer :: Text -> PuppetTypeValidate integers :: Text -> PuppetTypeValidate -- | Checks that a given parameter is set. mandatory :: Text -> PuppetTypeValidate -- | Checks that a given parameter is set unless the resources -- ensure is set to absent mandatoryIfNotAbsent :: Text -> PuppetTypeValidate inrange :: Integer -> Integer -> Text -> PuppetTypeValidate faketype :: PuppetTypeName -> (PuppetTypeName, PuppetTypeMethods) defaulttype :: PuppetTypeName -> (PuppetTypeName, PuppetTypeMethods) -- | Helper function that runs a validor on a PArray runarray :: Text -> (Text -> PValue -> PuppetTypeValidate) -> PuppetTypeValidate -- | Useful helper for buiding error messages perror :: Doc -> Either PrettyError Resource -- | This module holds the native Puppet resource types. module Puppet.NativeTypes -- | The map of native types. They are described in -- Puppet.NativeTypes.Helpers. baseNativeTypes :: Container PuppetTypeMethods -- | Contrary to the previous iteration, this will let non native types -- pass validateNativeType :: Resource -> InterpreterMonad Resource -- | This is an internal module. module Puppet.Interpreter.IO bs :: ByteString -> PrettyError defaultImpureMethods :: (Functor m, MonadIO m) => ImpureMethods m evalInstrGen :: (Functor m, Monad m) => InterpreterReader m -> InterpreterState -> ProgramViewT InterpreterInstr (State InterpreterState) a -> m (Either PrettyError a, InterpreterState, InterpreterWriter) interpretMonad :: (Functor m, Monad m) => InterpreterReader m -> InterpreterState -> InterpreterMonad a -> m (Either PrettyError a, InterpreterState, InterpreterWriter) -- | This module is all about converting and resolving foreign data into -- the fully exploitable corresponding data type. The main use case is -- the conversion of Expression to PValue. module Puppet.Interpreter.Resolve -- | A pure function for resolving variables. getVariable :: Container ScopeInformation -> Text -> Text -> Either Doc PValue -- | Turns a PValue into a Bool, as explained in the -- reference documentation. pValue2Bool :: PValue -> Bool -- | Resolves a variable, or throws an error if it can't. resolveVariable :: Text -> InterpreterMonad PValue -- | The main resolution function : turns an Expression into a -- PValue, if possible. resolveExpression :: Expression -> InterpreterMonad PValue -- | Resolves an UValue (terminal for the Expression data -- type) into a PValue resolveValue :: UValue -> InterpreterMonad PValue -- | Turns strings, numbers and booleans into Text, or throws an -- error. resolvePValueString :: PValue -> InterpreterMonad Text -- |
--   resolveExpressionString = resolveExpression >=> resolvePValueString
--   
resolveExpressionString :: Expression -> InterpreterMonad Text -- | Just like resolveExpressionString, but accepts arrays. resolveExpressionStrings :: Expression -> InterpreterMonad [Text] -- | A special helper function for argument like argument like pairs. resolveArgument :: Pair Text Expression -> InterpreterMonad (Pair Text PValue) -- | A hiera helper function, that will throw all Hiera errors and log -- messages to the main monad. runHiera :: Text -> HieraQueryType -> InterpreterMonad (Maybe PValue) -- | A simple helper that checks if a given type is native or a define. isNativeType :: Text -> InterpreterMonad Bool -- | Turns an unresolved SearchExpression from the parser into a -- fully resolved RSearchExpression. resolveSearchExpression :: SearchExpression -> InterpreterMonad RSearchExpression -- | 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. checkSearchExpression :: RSearchExpression -> Resource -> Bool -- | Turns a resource type and RSearchExpression into something that -- can be used in a PuppetDB query. searchExpressionToPuppetDB :: Text -> RSearchExpression -> Query ResourceField -- | Generates variable associations for evaluation of blocks. Each item -- corresponds to an iteration in the calling block. hfGenerateAssociations :: HFunctionCall -> InterpreterMonad [[(Text, PValue)]] -- | 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 ... hfSetvars :: [(Text, PValue)] -> InterpreterMonad (Container (Pair (Pair PValue PPosition) CurContainerDesc)) -- | Restores what needs restoring. This will erase all allocations. hfRestorevars :: Container (Pair (Pair PValue PPosition) CurContainerDesc) -> InterpreterMonad () -- | Tries to convert a pair of PValues into Numbers, as -- defined in attoparsec. If the two values can be converted, it will -- convert them so that they are of the same type toNumbers :: PValue -> PValue -> Maybe NumberPair -- | Converts class resource names to lowercase (fix for the jenkins -- plugin). fixResourceName :: Text -> Text -> Text -- | Evaluates a ruby template from what's generated by Erb.Parser. module Erb.Evaluate rubyEvaluate :: Container ScopeInformation -> Text -> [RubyStatement] -> Either Doc Text -- | A pure function for resolving variables. getVariable :: Container ScopeInformation -> Text -> Text -> Either Doc PValue -- | This is a set of pure helpers for evaluation the -- InterpreterMonad function that can be found in -- Puppet.Interpreter and Puppet.Interpreter.Resolve. They -- are used to power some prisms from Puppet.Lens. -- --
--   > dummyEval (resolveExpression (Addition "1" "2"))
--   Right (PString "3")
--   
module Puppet.Interpreter.Pure -- | Worst name ever, this is a set of pure stub for the -- ImpureMethods type. impurePure :: ImpureMethods Identity -- | A pure InterpreterReader, that can only evaluate a subset of -- the templates, and that can include only the supplied top level -- statements. pureReader :: HashMap (TopLevelType, Text) Statement -> InterpreterReader Identity -- | Evaluates an interpreter expression in a pure context. pureEval :: Facts -> HashMap (TopLevelType, Text) Statement -> InterpreterMonad a -> (Either PrettyError a, InterpreterState, InterpreterWriter) -- | A bunch of facts that can be used for pure evaluation. dummyFacts :: Facts -- | A default evaluation function for arbitrary interpreter actions. dummyEval :: InterpreterMonad a -> Either PrettyError a module Puppet.Parser expression :: Parser Expression puppetParser :: Parser (Vector Statement) runPParser :: Parser a -> SourceName -> Text -> Either ParseError a instance LookAheadParsing Parser instance CharParsing Parser instance Parsing Parser instance Monad Parser instance Functor Parser instance Applicative Parser instance Alternative Parser instance Foldable OperatorChain instance TokenParsing Parser module Puppet.Lens -- | Incomplete _PResolveExpression :: Prism' Expression PValue _PResolveValue :: Prism' UValue PValue _PHash :: Prism' PValue (Container PValue) _PBoolean :: Prism' PValue Bool _PString :: Prism' PValue Text _PNumber :: Prism' PValue Scientific _PResourceReference :: Prism' PValue (Text, Text) _PUndef :: Prism' PValue () _PArray :: Prism' PValue (Vector PValue) _PParse :: Prism' Text (Vector Statement) _ResourceDeclaration :: Prism' Statement (Text, Expression, Vector (Pair Text Expression), Virtuality, PPosition) _DefaultDeclaration :: Prism' Statement (Text, Vector (Pair Text Expression), PPosition) _ResourceOverride :: Prism' Statement (Text, Expression, Vector (Pair Text Expression), PPosition) _ConditionalStatement :: Prism' Statement (Vector (Pair Expression (Vector Statement)), PPosition) _ClassDeclaration :: Prism' Statement (Text, Vector (Pair Text (Maybe Expression)), Maybe Text, Vector Statement, PPosition) _DefineDeclaration :: Prism' Statement (Text, Vector (Pair Text (Maybe Expression)), Vector Statement, PPosition) _Node :: Prism' Statement (NodeDesc, Vector Statement, Maybe NodeDesc, PPosition) _VariableAssignment :: Prism' Statement (Text, Expression, PPosition) _MainFunctionCall :: Prism' Statement (Text, Vector Expression, PPosition) _SHFunctionCall :: Prism' Statement (HFunctionCall, PPosition) _ResourceCollection :: Prism' Statement (CollectorType, Text, SearchExpression, Vector (Pair Text Expression), PPosition) _Dependency :: Prism' Statement (Pair Text Expression, Pair Text Expression, LinkType, PPosition) _TopContainer :: Prism' Statement (Vector Statement, Statement) -- | Extracts the statements from ClassDeclaration, -- DefineDeclaration, Node and the spurious statements of -- TopContainer. _Statements :: Lens' Statement [Statement] _Equal :: Prism' Expression (Expression, Expression) _Different :: Prism' Expression (Expression, Expression) _Not :: Prism' Expression Expression _And :: Prism' Expression (Expression, Expression) _Or :: Prism' Expression (Expression, Expression) _LessThan :: Prism' Expression (Expression, Expression) _MoreThan :: Prism' Expression (Expression, Expression) _LessEqualThan :: Prism' Expression (Expression, Expression) _MoreEqualThan :: Prism' Expression (Expression, Expression) _RegexMatch :: Prism' Expression (Expression, Expression) _NotRegexMatch :: Prism' Expression (Expression, Expression) _Contains :: Prism' Expression (Expression, Expression) _Addition :: Prism' Expression (Expression, Expression) _Substraction :: Prism' Expression (Expression, Expression) _Division :: Prism' Expression (Expression, Expression) _Multiplication :: Prism' Expression (Expression, Expression) _Modulo :: Prism' Expression (Expression, Expression) _RightShift :: Prism' Expression (Expression, Expression) _LeftShift :: Prism' Expression (Expression, Expression) _Lookup :: Prism' Expression (Expression, Expression) _Negate :: Prism' Expression Expression _ConditionalValue :: Prism' Expression (Expression, Vector (Pair SelectorCase Expression)) _FunctionApplication :: Prism' Expression (Expression, Expression) _PValue :: Prism' Expression UValue module Puppet.Interpreter vmapM :: (Monad m, Foldable t) => (a -> m b) -> t a -> m [b] getModulename :: RIdentifier -> Text -- | 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. getCatalog :: Monad m => (forall a. InterpreterReader m -> InterpreterState -> InterpreterMonad a -> m (Either PrettyError a, InterpreterState, InterpreterWriter)) -> (TopLevelType -> Text -> m (Either PrettyError Statement)) -> (Either Text Text -> Text -> Container ScopeInformation -> m (Either PrettyError Text)) -> PuppetDBAPI m -> Text -> Facts -> Container PuppetTypeMethods -> Container ([PValue] -> InterpreterMonad PValue) -> HieraQueryFunc m -> ImpureMethods m -> HashSet Text -> m (Pair (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource])) [Pair Priority Doc]) isParent :: Text -> CurContainerDesc -> InterpreterMonad Bool finalize :: [Resource] -> InterpreterMonad [Resource] popScope :: InterpreterMonad () pushScope :: CurContainerDesc -> InterpreterMonad () evalTopLevel :: Statement -> InterpreterMonad ([Resource], Statement) getstt :: TopLevelType -> Text -> InterpreterMonad ([Resource], Statement) computeCatalog :: Text -> InterpreterMonad (FinalCatalog, EdgeMap, FinalCatalog, [Resource]) makeEdgeMap :: FinalCatalog -> InterpreterMonad EdgeMap realize :: [Resource] -> InterpreterMonad (Pair FinalCatalog FinalCatalog) evaluateNode :: Statement -> InterpreterMonad [Resource] evaluateStatementsVector :: Foldable f => f Statement -> InterpreterMonad [Resource] -- | Converts a list of pairs into a container, checking there is no -- duplicate fromArgumentList :: [Pair Text a] -> InterpreterMonad (Container a) evaluateStatement :: Statement -> InterpreterMonad [Resource] loadVariable :: Text -> PValue -> InterpreterMonad () -- | 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. loadParameters :: Foldable f => Container PValue -> f (Pair Text (Maybe Expression)) -> PPosition -> Maybe Text -> InterpreterMonad () data ScopeEnteringContext SENormal :: ScopeEnteringContext -- | We enter the scope as the child of another class SEChild :: !Text -> ScopeEnteringContext -- | We enter the scope as the parent of another class SEParent :: !Text -> ScopeEnteringContext -- | 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 enterScope :: ScopeEnteringContext -> CurContainerDesc -> Text -> PPosition -> InterpreterMonad Text dropInitialColons :: Text -> Text expandDefine :: Resource -> InterpreterMonad [Resource] loadClass :: Text -> Maybe Text -> Container PValue -> ClassIncludeType -> InterpreterMonad [Resource] addRelationship :: LinkType -> PValue -> Resource -> InterpreterMonad Resource addTagResource :: Resource -> Text -> Resource addAttribute :: OverrideType -> Text -> Resource -> PValue -> InterpreterMonad Resource registerResource :: Text -> Text -> Container PValue -> Virtuality -> PPosition -> InterpreterMonad [Resource] logWithModifier :: Priority -> (Doc -> Doc) -> [PValue] -> InterpreterMonad [Resource] mainFunctionCall :: Text -> [PValue] -> InterpreterMonad [Resource] evaluateHFC :: HFunctionCall -> InterpreterMonad [Resource] module Puppet.Stdlib -- | Contains the implementation of the StdLib functions. stdlibFunctions :: Container ([PValue] -> InterpreterMonad PValue) module Puppet.Preferences data Preferences m Preferences :: FilePath -> FilePath -> FilePath -> PuppetDBAPI m -> Container PuppetTypeMethods -> Container ([PValue] -> InterpreterMonad PValue) -> Maybe FilePath -> HashSet Text -> Preferences m -- | The path to the manifests. _manifestPath :: Preferences m -> FilePath -- | The path to the modules. _modulesPath :: Preferences m -> FilePath -- | The path to the template. _templatesPath :: Preferences m -> FilePath _prefPDB :: Preferences m -> PuppetDBAPI m -- | The list of native types. _natTypes :: Preferences m -> Container PuppetTypeMethods _prefExtFuncs :: Preferences m -> Container ([PValue] -> InterpreterMonad PValue) _hieraPath :: Preferences m -> Maybe FilePath -- | The set of ignored modules _ignoredmodules :: Preferences m -> HashSet Text class HasPreferences t_a1Lnm m_a1LmY | t_a1Lnm -> m_a1LmY where hieraPath = (preferences . go_a1Lno) where go_a1Lno _f_a1Lnp (Preferences __manifestPath_a1Lnq __modulesPath_a1Lnr __templatesPath_a1Lns __prefPDB_a1Lnt __natTypes_a1Lnu __prefExtFuncs_a1Lnv __hieraPath'_a1Lnw __ignoredmodules_a1Lny) = ((\ __hieraPath_a1Lnx -> Preferences __manifestPath_a1Lnq __modulesPath_a1Lnr __templatesPath_a1Lns __prefPDB_a1Lnt __natTypes_a1Lnu __prefExtFuncs_a1Lnv __hieraPath_a1Lnx __ignoredmodules_a1Lny) <$> (_f_a1Lnp __hieraPath'_a1Lnw)) ignoredmodules = (preferences . go_a1Lnz) where go_a1Lnz _f_a1LnA (Preferences __manifestPath_a1LnB __modulesPath_a1LnC __templatesPath_a1LnD __prefPDB_a1LnE __natTypes_a1LnF __prefExtFuncs_a1LnG __hieraPath_a1LnH __ignoredmodules'_a1LnI) = ((\ __ignoredmodules_a1LnJ -> Preferences __manifestPath_a1LnB __modulesPath_a1LnC __templatesPath_a1LnD __prefPDB_a1LnE __natTypes_a1LnF __prefExtFuncs_a1LnG __hieraPath_a1LnH __ignoredmodules_a1LnJ) <$> (_f_a1LnA __ignoredmodules'_a1LnI)) manifestPath = (preferences . go_a1LnK) where go_a1LnK _f_a1LnL (Preferences __manifestPath'_a1LnM __modulesPath_a1LnO __templatesPath_a1LnP __prefPDB_a1LnQ __natTypes_a1LnR __prefExtFuncs_a1LnS __hieraPath_a1LnT __ignoredmodules_a1LnU) = ((\ __manifestPath_a1LnN -> Preferences __manifestPath_a1LnN __modulesPath_a1LnO __templatesPath_a1LnP __prefPDB_a1LnQ __natTypes_a1LnR __prefExtFuncs_a1LnS __hieraPath_a1LnT __ignoredmodules_a1LnU) <$> (_f_a1LnL __manifestPath'_a1LnM)) modulesPath = (preferences . go_a1LnV) where go_a1LnV _f_a1LnW (Preferences __manifestPath_a1LnX __modulesPath'_a1LnY __templatesPath_a1Lo0 __prefPDB_a1Lo1 __natTypes_a1Lo2 __prefExtFuncs_a1Lo3 __hieraPath_a1Lo4 __ignoredmodules_a1Lo5) = ((\ __modulesPath_a1LnZ -> Preferences __manifestPath_a1LnX __modulesPath_a1LnZ __templatesPath_a1Lo0 __prefPDB_a1Lo1 __natTypes_a1Lo2 __prefExtFuncs_a1Lo3 __hieraPath_a1Lo4 __ignoredmodules_a1Lo5) <$> (_f_a1LnW __modulesPath'_a1LnY)) natTypes = (preferences . go_a1Lo6) where go_a1Lo6 _f_a1Lo7 (Preferences __manifestPath_a1Lo8 __modulesPath_a1Lo9 __templatesPath_a1Loa __prefPDB_a1Lob __natTypes'_a1Loc __prefExtFuncs_a1Loe __hieraPath_a1Lof __ignoredmodules_a1Log) = ((\ __natTypes_a1Lod -> Preferences __manifestPath_a1Lo8 __modulesPath_a1Lo9 __templatesPath_a1Loa __prefPDB_a1Lob __natTypes_a1Lod __prefExtFuncs_a1Loe __hieraPath_a1Lof __ignoredmodules_a1Log) <$> (_f_a1Lo7 __natTypes'_a1Loc)) prefExtFuncs = (preferences . go_a1Loh) where go_a1Loh _f_a1Loi (Preferences __manifestPath_a1Loj __modulesPath_a1Lok __templatesPath_a1Lol __prefPDB_a1Lom __natTypes_a1Lon __prefExtFuncs'_a1Loo __hieraPath_a1Loq __ignoredmodules_a1Lor) = ((\ __prefExtFuncs_a1Lop -> Preferences __manifestPath_a1Loj __modulesPath_a1Lok __templatesPath_a1Lol __prefPDB_a1Lom __natTypes_a1Lon __prefExtFuncs_a1Lop __hieraPath_a1Loq __ignoredmodules_a1Lor) <$> (_f_a1Loi __prefExtFuncs'_a1Loo)) prefPDB = (preferences . go_a1Lot) where go_a1Lot _f_a1Lou (Preferences __manifestPath_a1Lov __modulesPath_a1Low __templatesPath_a1Lox __prefPDB'_a1Loy __natTypes_a1LoA __prefExtFuncs_a1LoB __hieraPath_a1LoC __ignoredmodules_a1LoD) = ((\ __prefPDB_a1Loz -> Preferences __manifestPath_a1Lov __modulesPath_a1Low __templatesPath_a1Lox __prefPDB_a1Loz __natTypes_a1LoA __prefExtFuncs_a1LoB __hieraPath_a1LoC __ignoredmodules_a1LoD) <$> (_f_a1Lou __prefPDB'_a1Loy)) templatesPath = (preferences . go_a1LoE) where go_a1LoE _f_a1LoF (Preferences __manifestPath_a1LoG __modulesPath_a1LoH __templatesPath'_a1LoI __prefPDB_a1LoK __natTypes_a1LoL __prefExtFuncs_a1LoM __hieraPath_a1LoN __ignoredmodules_a1LoO) = ((\ __templatesPath_a1LoJ -> Preferences __manifestPath_a1LoG __modulesPath_a1LoH __templatesPath_a1LoJ __prefPDB_a1LoK __natTypes_a1LoL __prefExtFuncs_a1LoM __hieraPath_a1LoN __ignoredmodules_a1LoO) <$> (_f_a1LoF __templatesPath'_a1LoI)) preferences :: HasPreferences t_a1Lnm m_a1LmY => Lens' t_a1Lnm (Preferences m_a1LmY) hieraPath :: HasPreferences t_a1Lnm m_a1LmY => Lens' t_a1Lnm (Maybe FilePath) ignoredmodules :: HasPreferences t_a1Lnm m_a1LmY => Lens' t_a1Lnm (HashSet Text) manifestPath :: HasPreferences t_a1Lnm m_a1LmY => Lens' t_a1Lnm FilePath modulesPath :: HasPreferences t_a1Lnm m_a1LmY => Lens' t_a1Lnm FilePath natTypes :: HasPreferences t_a1Lnm m_a1LmY => Lens' t_a1Lnm (Container PuppetTypeMethods) prefExtFuncs :: HasPreferences t_a1Lnm m_a1LmY => Lens' t_a1Lnm (Container ([PValue] -> InterpreterMonad PValue)) prefPDB :: HasPreferences t_a1Lnm m_a1LmY => Lens' t_a1Lnm (PuppetDBAPI m_a1LmY) templatesPath :: HasPreferences t_a1Lnm m_a1LmY => Lens' t_a1Lnm FilePath genPreferences :: FilePath -> IO (Preferences IO) instance HasPreferences (Preferences m0) m0 module Puppet.Daemon -- | This is a high level function, that will initialize the parsing and -- interpretation infrastructure from the Prefs structure, and -- will return a function that will take a node name, Facts and -- return either an error or the FinalCatalog, along with the -- dependency graph and catalog of exported resources. It also return a -- few IO functions that can be used in order to query the daemon for -- statistics, following the format in Puppet.Stats. -- -- It will internaly initialize a thread for the LUA interpreter, and a -- thread for the Ruby one. It should cache the AST of every .pp file, -- and could use a bit of memory. As a comparison, it fits in 60 MB with -- the author's manifests, but really breathes when given 300 MB of heap -- space. In this configuration, even if it spawns a ruby process for -- every template evaluation, it is way faster than the puppet stack. -- -- It can optionnaly talk with PuppetDB, by setting an URL in the -- Prefs data structure. The recommended way to set it to -- http:localhost:8080 and set a SSH tunnel : -- --
--   ssh -L 8080:localhost:8080 puppet.host
--   
-- -- Known bugs : -- -- initDaemon :: Preferences IO -> IO DaemonMethods logDebug :: Text -> IO () logInfo :: Text -> IO () logWarning :: Text -> IO () logError :: Text -> IO () -- | A stub implementation of PuppetDB, backed by a YAML file. module PuppetDB.TestDB -- | Initializes the test DB using a file to back its content loadTestDB :: FilePath -> IO (Either PrettyError (PuppetDBAPI IO)) -- | Starts a new PuppetDB, without any backing file. initTestDB :: IO (PuppetDBAPI IO) instance ToJSON DBContent instance FromJSON DBContent instance HasBackingFile DBContent (Maybe FilePath) instance HasFacts DBContent (Container Facts) instance HasResources DBContent (Container WireCatalog) -- | Common data types for PuppetDB. module PuppetDB.Common -- | The supported PuppetDB implementations. data PDBType -- | Your standard PuppetDB, queried through the HTTP interface. PDBRemote :: PDBType -- | A stupid stub, this is the default choice. PDBDummy :: PDBType -- | A slow but handy PuppetDB implementation that is backed by a YAML -- file. PDBTest :: PDBType -- | Given a PDBType, will try return a sane default implementation. getDefaultDB :: PDBType -> IO (Either PrettyError (PuppetDBAPI IO)) -- | Turns a FinalCatalog and EdgeMap into a document that -- can be serialized and fed to puppet apply. generateWireCatalog :: Nodename -> FinalCatalog -> EdgeMap -> WireCatalog instance Eq PDBType instance Read PDBType module Puppet.Testing -- | Run given spec and write a report to stdout. Exit with -- exitFailure if at least one spec item fails. hspec :: Spec -> IO () -- | This tests that file sources are valid. basicTest :: PSpec -- | This tests that all users and groups used as resource parameters are -- defined usersGroupsDefined :: PSpec -- | Initializes a daemon made for running tests, using the specific test -- puppetDB testingDaemon :: PuppetDBAPI IO -> FilePath -> (Text -> IO Facts) -> IO (Text -> IO (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource]))) -- | A default testing daemon. defaultDaemon :: FilePath -> IO (Text -> IO (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource]))) testCatalog :: Nodename -> FilePath -> FinalCatalog -> PSpec -> IO Summary describeCatalog :: Nodename -> FilePath -> FinalCatalog -> PSpec -> Spec it :: Example a => String -> PSpecM a -> PSpec shouldBe :: (Show a, Eq a) => a -> a -> PSpecM Expectation type PSpec = PSpecM () type PSpecM = ReaderT TestEnv SpecM lCatalog :: HasTestEnv t_a1RH6 => Lens' t_a1RH6 FinalCatalog lModuledir :: HasTestEnv t_a1RH6 => Lens' t_a1RH6 FilePath lPuppetdir :: HasTestEnv t_a1RH6 => Lens' t_a1RH6 FilePath -- | Run tests on a specific resource withResource :: String -> Text -> Text -> (Resource -> Expectation) -> PSpec -- | Tests a specific parameter withParameter :: Text -> Resource -> (PValue -> Expectation) -> Expectation -- | Test a serie of parameters withParameters :: [(Text, PValue)] -> Resource -> Expectation -- | Retrieves a given file content, and runs a test on it. It works on the -- explicit content parameter, or can resolve the source -- parameter to open the file. withFileContent :: String -> Text -> (Text -> Expectation) -> PSpec instance HasTestEnv TestEnv