Relationships and ordering
By default, Puppet treats all resources as independent of each other, which means they can be applied in any order. This is different from traditional declarative code, which runs line by line and executes in the order it is written. One of the main advantages of Puppet’s approach is that if a single part of the code fails, Puppet will continue to apply all other resources. This eliminates the need to stop or have substantial failure handling in place to continue code. As a result, Puppet can bring a client server as close to the desired state as possible, even if some resources fail.
It’s clear that some resources will be dependent on each other, such as a configuration file that can only exist after a package has been installed. Puppet provides metaparameters to create these dependencies:
before
: The resource should be applied before the named resource(s).require
: The resource should be applied after the named resource(s). ...