Provide the reason why a resource was skipped during a puppet run
|Assignee:||Deepak Giridharagopal||% Done:|
|Affected Puppet version:||Branch:|
This feature is a pre-requisite for some of PuppetDB’s new reports functionality (although we have some possible workarounds for the short term and for backwards compatibility).
During a puppet run, if a resource fails to apply and there are other resources in the catalog that have a dependency on the failed resource, these resources are marked as “skipped”. There are no events generated for them in the report, and there does not appear to be any data in the report that would allow us to determine why they were skipped. We are aware of at least two other reasons why a resource might be skipped: Scheduled resources and tags.
The feature request for PuppetDB is that for any resource that was skipped due to a failed dependency, we’d like to be able to show the upstream failure so that it’s easy for the admin to identify the root cause of a particular problem. At present, it seems like the best we can do is to capture all skipped resources and check each one to see if there were upstream failures; if so, we can reasonably guess that that is why the resource was skipped, but even then we still can’t be absolutely certain. Furthermore, this will probably be a fairly slow query.
To solve this in Puppet, we could either change the data type of the “skipped” field from boolean to an enumeration (which might include, e.g., :false, :failed_dependency, :not_scheduled, :tags), or we could keep it as a boolean and add a new field to store the “reason”.
In the interim (and for as long as we maintain backwards compatibility with versions of puppet that do not have this fix), we’ll probably need to display some message in the PE UI that indicates that we’re just guessing :)