Method: Puppet::Pops::Evaluator::DeferredResolver.resolve_and_replace

Defined in:
lib/puppet/pops/evaluator/deferred_resolver.rb

.resolve_and_replace(facts, catalog, environment = catalog.environment_instance, preprocess_deferred = true) ⇒ nil

Resolves and replaces all Deferred values in a catalog’s resource attributes found as direct values or nested inside Array, Hash or Sensitive values. Deferred values inside of custom Object instances are not resolved as this is expected to be done by such objects.

Parameters:

Returns:

  • (nil)

    does not return anything - the catalog is modified as a side effect



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/puppet/pops/evaluator/deferred_resolver.rb', line 39

def self.resolve_and_replace(facts, catalog, environment = catalog.environment_instance, preprocess_deferred = true)
  compiler = Puppet::Parser::ScriptCompiler.new(environment, catalog.name, preprocess_deferred)
  resolver = new(compiler, preprocess_deferred)
  resolver.set_facts_variable(facts)
  # TODO:
  #    # When scripting the trusted data are always local, but set them anyway
  #    @scope.set_trusted(node.trusted_data)
  #
  #    # Server facts are always about the local node's version etc.
  #    @scope.set_server_facts(node.server_facts)

  resolver.resolve_futures(catalog)
  nil
end