This module exports the
getCatalog function, that computes catalogs from
parsed manifests. The behaviour of this module is probably non canonical on many
details. The problem is that most of Puppet behaviour is undocumented or
extremely vague. It might be possible to delve into the source code or to write
tests, but ruby is unreadable and tests are boring.
Here is a list of known discrepencies with Puppet :
- Resources references using the <| |> syntax are not yet supported.
- Things defined in classes that are not included cannot be accessed. In vanilla puppet, you can use subclass to classes that are not imported themselves.
- Amending attributes with a reference will not cause an error when done out of an inherited class.
- Variables $0 to $9, set after regexp matching, are not handled.
- Tags work like regular parameters, and are not automatically populated or inherited.
- Modules, nodes, classes and type names starting with _ are allowed.
- Arrows between resource declarations or collectors are not yet handled.
- Reversed form arrows are not handled.
- Node inheritance is not handled, and class inheritance seems to work well, but is probably not Puppet-perfect.
- getCatalog :: (TopLevelType -> String -> IO (Either String Statement)) -> (String -> String -> Map String GeneralValue -> IO (Either String String)) -> Maybe (String -> Query -> IO (Either String [CResource])) -> String -> Facts -> Maybe String -> Map PuppetTypeName PuppetTypeMethods -> IO (Either String (FinalCatalog, EdgeMap, FinalCatalog), [String])
|:: (TopLevelType -> String -> IO (Either String Statement))|
The "get statements" function. Given a top level type and its name it should return the corresponding statement.
|-> (String -> String -> Map String GeneralValue -> IO (Either String String))|
The "get template" function. Given a file name, a scope name and a list of variables, it should return the computed template.
|-> Maybe (String -> Query -> IO (Either String [CResource]))|
The "puppetDB Rest API" function. Given the machine fqdn, a request type (resources, nodes, facts, ..) and a query, it returns a ResolvedValue, or some error.
Name of the node.
Facts of this node.
|-> Maybe String|
Path to the modules, for user plugins. If set to Nothing, plugins are disabled.
|-> Map PuppetTypeName PuppetTypeMethods|
The list of native types
|-> IO (Either String (FinalCatalog, EdgeMap, FinalCatalog), [String])|