Ask Your Question

Raising / catching errors in puppet

asked 2013-08-14 20:52:10 -0600

peter gravatar image

this might be against the what the framework is for but i've encountered several situations where i might want to raise an error: a particular file may be expected, some output from a program whatever.

similarly sometimes i want to catch an error: if i'm pushing database work through puppet, when the install script goes wrong i'd like to log the details to some other system.

are either of these possible?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-08-14 21:28:19 -0600

If you can check for the error condition in a normal manifest, you can use the fail("message goes here") function.

Maybe another of the listed functions might help, too?

edit flag offensive delete link more

answered 2015-10-05 09:46:34 -0600

dalen gravatar image

This new module I made should help you catch exceptions and do something else instead:

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-08-14 20:52:10 -0600

Seen: 7,529 times

Last updated: Oct 05 '15