[chef] Re: Re: Re: Customizing the templates of a community cookbook?


Chronological Thread 
  • From: Morgan Blackthorne < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: Customizing the templates of a community cookbook?
  • Date: Mon, 27 May 2013 07:25:30 -0700

So after some more research, it looks like my particular case is a little more complicated than I thought. While the nagios::server recipe ends up using templates in the end, these are done via the nagios_conf definition:

define :nagios_conf, :variables => {}, :config_subdir => true do

  conf_dir = params[:config_subdir] ? node['nagios']['config_dir'] : node['nagios']['conf_dir']

  template "#{conf_dir}/#{params[:name]}.cfg" do
    owner node['nagios']['user']
    group node['nagios']['group']
    source "#{params[:name]}.cfg.erb"
    mode 00644
    variables params[:variables]
    notifies :reload, "service[nagios]"
    backup 0
  end
end

I'm not sure how to override a definition.

--
~*~ StormeRider ~*~

"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS


On Sun, May 26, 2013 at 1:45 PM, Zac Stevens < " target="_blank"> > wrote:
Hi Steffen,

On Sun, May 26, 2013 at 3:47 PM, Steffen Gebert < " target="_blank"> > wrote:
I used to use chef-rewind until I got the tip form Joshua to just access
the resource collection via resources().

So, I'd be interested in what's the benefit of the chef-rewind gem?

Functionally, there's no benefit/difference - it's just a little "syntactic sugar".  Some people may prefer chef-rewind's syntax, even when they know how to do it directly.  Similarly, ruby-averse Chef users may find it a little easier to use; a shallower learning curve makes a big difference in some teams.


Zac





Archive powered by MHonArc 2.6.16.

§