[chef] How to call a definition from a ruby_block?


Chronological Thread 
  • From: Allan Wind < >
  • To:
  • Subject: [chef] How to call a definition from a ruby_block?
  • Date: Wed, 5 Oct 2011 15:14:26 -0400

I am trying to write a recipe that installs munin-node[1], and 
subsequently syncs the plugins (files) and plugin-conf.d 
directories based on an attribute value.

package 'munin-node' do
        action [:enable, :start]
        notifies 'sync plugins'
end


ruby_block 'sync plugins' do
        block do
                # how do a call the munin_plugin here?
        end
end

definitions/munin_plugin.rb:

define :munin_plugin do
        ...
end

It seems quite complicated so if I missed an easier route to 
running post-install ruby code that makes use use of Chef 
resources.

[1] Yes, I am aware of the existing munin plugin.  It does not 
have this feature, and requires a chef server while I am using 
chef-solo.


/Allan
-- 
Allan Wind
Life Integrity, LLC
<http://lifeintegrity.com>


  • [chef] How to call a definition from a ruby_block?, Allan Wind, 10/05/2011

Archive powered by MHonArc 2.6.16.

§