Ask Your Question
0

How can i add rescue block

asked 2016-07-03 23:07:17 -0600

venky gravatar image

I want to add rescue / exception handling catch block , If something fails in my code deployment it will notify by running code inside rescue block.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-07-04 00:40:54 -0600

updated 2016-07-04 00:42:50 -0600

Puppet doesn't have rescue / exception handling, because it's a declarative language intended for modelling the desired end state of systems, rather than a procedural language like Ruby, Python or Java. In Puppet you say "what" you want without saying "how" you want it to be achieved. You may need to share your code and explain in more detail what it is you're trying to do.

edit flag offensive delete link more

Comments

The purpose is to handle errors, its supporting by Ansible http://docs.ansible.com/ansible/playbooks_blocks.html#error-handling

venky gravatar imagevenky ( 2016-07-04 05:28:17 -0600 )edit

Use Case: I am running docker containers in servers dev,staging and prod and my image version is 10.0 Suppose i have new code release 11.0 with new image available so i changes puppet code to 11.0 but if it fails to pull then i need notification message / emails through error handing.

venky gravatar imagevenky ( 2016-07-04 05:29:38 -0600 )edit

It may be handled by Ansible but Ansible is quite different from Puppet. Ansible is an orchestration tool; Puppet is a configuration management tool. I suspect you're trying to make Puppet do things it's not designed for.

Alex Harvey gravatar imageAlex Harvey ( 2016-07-04 09:18:55 -0600 )edit

I understand, My case is Using mcoolective trigger deployment across multiple servers. If it fails in one server due some disk space issue how should i know deployment failed in one server. ?

venky gravatar imagevenky ( 2016-07-07 22:10:05 -0600 )edit

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: 2016-07-03 23:07:17 -0600

Seen: 51 times

Last updated: Jul 04 '16