Class | Puppet::Parser::Compiler |
In: |
lib/puppet/parser/compiler.rb
|
Parent: | Object |
Maintain a graph of scopes, along with a bunch of data about the individual catalog we‘re compiling.
catalog | [R] | |
collections | [R] | |
facts | [R] | |
node | [R] | |
node_scope | [R] | |
parser | [R] | |
resources | [R] |
Set up our compile. We require a parser and a node object; the parser is so we can look up classes and AST nodes, and the node has all of the client‘s info, like facts and environment.
Store the fact that we‘ve evaluated a class, and store a reference to the scope in which it was evaluated, so that we can look it up later.
Compiler our catalog. This mostly revolves around finding and evaluating classes. This is the main entry into our catalog.
Evaluate each specified class in turn. If there are any classes we can‘t find, just tag the catalog and move on. This method really just creates resource objects that point back to the classes, and then the resources are themselves evaluated later in the process.
Find the parent of a given scope. Assumes scopes only ever have one in edge, which will always be true.
The top scope is usually the top-level scope, but if we‘re using AST nodes, then it is instead the node‘s scope.