Do services have an implicit dependency on the binary executable?

19 views
Skip to first unread message

David Karr

unread,
Feb 19, 2016, 5:32:37 PM2/19/16
to Puppet Users
I just started reading about Puppet a few days ago, so some of my questions may be simple.

I noticed that you can specify explicit dependencies between resources in several ways.  There are also a small number of cases where Puppet adds implicit dependencies (file to parent directory, for instance).

I noticed that the "service" resource type has a "binary" property, which points to the executable file.  In an example I saw in a book, it uses the subscribe metaparameter, specifying the executable file path.  This situation seems like an obvious place for an implicit dependency, which if that was present, would make the explicit dependency redundant.

Is there an implicit dependency relationship here?

jcbollinger

unread,
Feb 22, 2016, 9:36:33 AM2/22/16
to Puppet Users

TLDR: no.

In more detail:

That's a fair question.  For resource types packaged with Puppet itself, you should be able to find answers in the Resource Type Reference.  Look for a section marked "Autorequires" in the type description.  For example, the File resource's description has such a section, and it specifies that "If Puppet is managing the user or group that owns a file, the file resource will autorequire them. If Puppet is managing any parent directories of a file, the file resource will autorequire them."  The Service resource, on the other hand, does not have any autorequires documented in its description.

Indeed, PL has been fairly conservative about creating autorequirements.  I'm uncertain whether they have a specific internal policy for when to allow or provide them, but empirically, the approach seems to be to reserve autorequirements for cases where the case for their inclusion is clear and compelling -- at least for the case where the resources involved are being ensured present, or the equivalent.  This is a good thing, because autorequirements that kick in when you don't expect or want them can be a real pain.


John

Reply all
Reply to author
Forward
0 new messages