[chef] How to override the source erb template from another custom cookbook?


Chronological Thread 
  • From: Millisami < >
  • To:
  • Subject: [chef] How to override the source erb template from another custom cookbook?
  • Date: Wed, 4 Jul 2012 05:11:07 -0700 (PDT)


Hi Chefellas!

In the chef-client cookbook, following is the template recource:

template "#{node["chef_client"]["conf_dir"]}/client.rb" do
  source "client.rb.erb"
  owner "root"
  group root_group
  mode 0644
  variables :chef_node_name => chef_node_name
  notifies :create, "ruby_block[reload_client_config]"
end


I want to replace/override the contents of the `client.rb.erb` template that 
is
inside the `templates/default/client.rb.erb`, with my other cookbook that will
run later.

Duplicating and doing the same thing my own cookbook/recipes with templates is
doable. But is this the a good practice is such case?



Archive powered by MHonArc 2.6.16.

§