[chef] Re: Re: Force recipe to run at the end


Chronological Thread 
  • From: Julien Vehent < >
  • To: < >
  • Subject: [chef] Re: Re: Force recipe to run at the end
  • Date: Sat, 22 Sep 2012 20:22:18 -0400


Thanks a lot for the {quick,efficient} replies ! I understand better the whole compile/runtime separation now.

I have other cookbooks that create rules, but those rules won't appear until
the next chef run when AFW runs again. I would like to converge in one run
instead, by forcing AFW to run after everyone else.

This sounds like you're trying to pass in your rules using "variables" or
something...


Correct. I have a recipe for haproxy that does this:

    def foo()
      # add server to outbound firewall rules
      node['afw']['rules']\
          ["Haproxy local LB to #{server['hostname']}:#{port}"] = {
            'protocol' => 'tcp',
            'direction' => 'out',
            'user' => 'haproxy',
            'destination' => "#{server['hostname']}",
            'dport' => "#{port}"
          }
    end

If I add a provider to the AFW cookbook and call the provider in ruby in the haproxy cookbook, then the haproxy rule should be added at compile time. correct ?

  def foo()
    afw_add_rule(name, protocol, direction, user, destination, ...)
  end

Thanks,
Julien




Archive powered by MHonArc 2.6.16.

§