[chef] transactional recipe


Chronological Thread 
  • From: Daneel Yaitskov < >
  • To:
  • Subject: [chef] transactional recipe
  • Date: Mon, 25 Nov 2013 17:03:45 +0400

All,


I faced with complex relation between resources.
Let's look at this:

remote_file copies a disk image
execute losetup binds the image with a device
execute mount attaches the device to the filesystem
directory creates folder on the mounted image.

This recipe is not reliable because of an exception in a middle of the recipe
requires manual intervention to reset environment.

I.e. I should unmount the device because the first resource would write to mounted .

I could wrap all these resources inside of one ruby_block and use a lot nested begin/ensure
but then I lose any profit of the chef.

I want to preserve linear structure of the recipe and set rollback callbacks on successfully executed resources.

Is there any standard way?

--
Daneel S. Yaitskov



Archive powered by MHonArc 2.6.16.

§