How do you configure puppet to just stop on the first failure instead of continuing on and just spewing errors for the rest of the steps that depends on the first failure?
Asked
Active
Viewed 5,264 times
11
-
2What, exactly, are you trying to achieve? Puppet is designed as an idemopotent, holistic, state-enforcement tool. – msanford Aug 05 '14 at 02:25
-
If the rest are the steps are setup properly as dependants (require) I didn't think it would continue to execute, never has with me. It will of course do anything else not dependant on those resources. Note to self: look at the date of the question.. ugh. – AndyC Oct 28 '14 at 03:28
-
2I can't speak for the OP, but I am trying to set up a Vagrant test bed for an existing puppet setup I've inherited. The first error appears after seconds, but it continues spewing errors for minutes afterwards. (A lot of packages are installed.) I would like it to stop after the first error so I can shorten my investigate-change-test loop. – Stig Brautaset Aug 27 '15 at 10:30
-
1Add this to the huge list of things puppet doesn't do properly. Hashtag BuiltForAdminsByNonAdmins – Otheus Oct 24 '16 at 17:29
-
1An old discussion of the feature (seemingly no solutions sadly) https://projects.puppetlabs.com/issues/3933 – phs May 26 '17 at 19:56
2 Answers
4
This is not possible with puppet. The puppet master will build the graph with what needs to be done. Puppet will start executing the graphs nodes. If one node fails, all dependent nodes will fail also. Everything else gets executed.
Stages are the same: if anything goes wrong in a stage, all dependent stages will automatically fail.

cristi
- 573
- 4
- 18
-
Assuming this answer is accurate, I don't see why anyone would downvote this... – mmey Jan 07 '15 at 21:09
-
4What bewildering behaviour that is! I'm trying to set up a vagrant test bed for our puppet provisioning, which takes a while to run. (Minutes, as it's pulling big packages etc.) I would *love* for it to have a flag where I can ask it to halt at the first error (which occur in seconds) so I can investigate one at a time, rather than spewing hundreds of errors and taking minutes to run. – Stig Brautaset Aug 27 '15 at 10:22
1
See the official documentation of the puppet function "fail".
Here is an example:
fail{'here goes your message':}