[chef] Re: Re: Re: "edit" your resources in a library cookbook from an application cookbook


Chronological Thread 
  • From: Bryan Berry < >
  • To:
  • Subject: [chef] Re: Re: Re: "edit" your resources in a library cookbook from an application cookbook
  • Date: Tue, 13 Nov 2012 06:19:20 +0100

Hey Lamont, 

I intent to send a pull request to include chef-rewind into chef itself. If that PR is accepted, you won't have to add it to a cookbook at all

On Tue, Nov 13, 2012 at 5:53 AM, Lamont Granquist < " target="_blank"> > wrote:

FWIW, I took this and simply dropped it into the libraries folder in a chef cookbook.

Then easily used it to take the portertech redis cookbook and monkeypatched the redis.conf template it in for 2.6.4

% cat sk_chef_rewind/libraries/rewind.rb
[...chef_rewind library...]

% cat sk_redis/metadata.rb
depends "sk_chef_rewind"

% cat sk_redis/recipes/default.rb
rewind "template[#{node['redis']['conf_dir']}/redis.conf]" do
  cookbook_name "sk_redis"
end

% cat sk_redis/templates/default/redis.conf.erb
[...redis.conf template hacked up to remove vm-* options and rename some others...]

% cat roles/redis.rb
name "redis"
description "role for deploying redis"
override_attributes({
  "redis" => {
    "install_type" => "source"
  }
})
run_list(
  "recipe[portertech_redis::server]",
  "recipe[sk_redis]"
)





Archive powered by MHonArc 2.6.16.

§