0

In what order resources that are mapped in an array for attributes like require, subscribe, before and notify execute ? Also, when execute, will it fetch all resources at once and runs in parallel or is it synchronized ?

For example,

exec { 'A': }
exec { 'B': }
exec { 'C': }
exec { 'D': require=>[ Exec['A'], Exec['B'], Exec['C'] ]}

Exec['D'] depends on Exec[A], Exec[B] and Exec[C]. When Exec[D] gets a chance to execute, how's the flow going to be ?

A, B and C runs in parallel in any order ?

or

First A, then B and finally C. Run in order, but none of the resources wait fore the previous resource to complete ?

or

First A, then B but wait for A to complete before it start and finally C but wait for B to complete

Kenshin
  • 109
  • 5

1 Answers1

1

First: Puppet does not run anything in parallel.
It is purely sequential.
There is always only one resource being applied, the next one will always wait for the previous to finish.

Second: The order depends on a few things.
The behaviour changed between Puppet 3 and 4.
You should look at this documentation page for your version:
https://docs.puppet.com/puppet/4.7/reference/lang_relationships.html

And more specifically at this option:
https://docs.puppet.com/puppet/latest/reference/configuration.html#ordering

In the past (Puppet 3.x) this was set to title-hash.
Meaning in your case that A, B and C run in a random (sequential) order and then afterwards D runs.

Starting at Puppet 4.x this is now set to manifest by default.
In your case that would run first A, then B, then C and then D.

faker
  • 17,496
  • 2
  • 60
  • 70