Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/puppet/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2100,14 +2100,16 @@ def self.initialize_default_settings!(settings)
what is being done.",
},
:preprocess_deferred => {
:default => false,
:default => true,
:type => :boolean,
:desc => "Whether Puppet should call deferred functions before applying
the catalog. If set to `true`, all prerequisites required for the
deferred function must be satisfied before the Puppet run. If set to
`false`, deferred functions follow Puppet relationships and
ordering. In this way, Puppet can install the prerequisites required for a
deferred function and call the deferred function in the same run.",
deferred function and call the deferred function in the same run.
Please note that many functions that return complex datatypes will fail
when disabling preprocessing and this option may be removed in the future.",
},
:summarize => {
:default => false,
Expand Down
1 change: 1 addition & 0 deletions spec/integration/application/agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def copy_fixtures(sources, dest)
end

it "applies a deferred function and its prerequisite in the same run" do
Puppet[:preprocess_deferred] = false
catalog_handler = -> (req, res) {
catalog = compile_to_catalog(deferred_manifest, node)
res.body = formatter.render(catalog)
Expand Down
2 changes: 2 additions & 0 deletions spec/integration/application/apply_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ def bogus()
end

it "applies a deferred function and its prerequisite in the same run" do
Puppet[:preprocess_deferred] = false
apply.command_line.args = ['-e', deferred_manifest]
expect {
apply.run
Expand Down Expand Up @@ -754,6 +755,7 @@ def bogus()
end

it "evaluates resources before validating the deferred resource" do
Puppet[:preprocess_deferred] = false
manifest = <<~END
notify { 'runs before file': } ->
file { '#{deferred_file}':
Expand Down
Loading