The document you mentioned has given the best explanation. If you try to understand it by simple way, using the exist sample.
Package['ntp'] -> File['/etc/ntp.conf'] ~> Service['ntpd']
For File['/etc/ntp.conf']
, puppet needs to make sure that the package ntp
has been installed before it creates or updates the file ntp.conf
. There is no restart request.
But for Service['ntpd'], ntp.conf
needs to exist first - that's the same order as ->
. * But if puppet finds the file ntp.conf
has any changes (whether it is created or updated), service ntp needs to be restarted. That's the difference*.
For more reading about ordering in puppet, please see these documents:
Learning Puppet — Resource Ordering
And do some testing by yourself to understand how it works.
- set Package['ntp'], File['/etc/ntp.conf'] ,Service['ntpd'] with the order.
- run puppet apply to make sure, Package/File/Service are ready on the system.
- make a change in the file ntp.conf.
- enable the
--debug
option with the puppet apply
command. The debug log will give you detail in the background - for example, you should see that the file gets updated and the ntpd service gets restarted.