Ask Your Question
1

Raising / catching errors in puppet

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

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
1

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

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
0

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

dalen gravatar image

This new module I made should help you catch exceptions and do something else instead: https://forge.puppetlabs.com/dalen/tr...

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

Stats

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

Seen: 5,358 times

Last updated: Oct 05 '15