- From: Phil Dibowitz <
>
- To:
- Subject: [chef] Re: Re: Re: Force recipe to run at the end
- Date: Sat, 22 Sep 2012 20:08:48 -0700
On 09/22/2012 05:22 PM, Julien Vehent wrote:
>
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
OK, so that's fine, you're adding to the node object, which you have access to
from the template. Don't pass that data into the template via "variables",
just access node directly in the template ERB and you have access to all the
data added anywhere in any cookbook.
--
Phil Dibowitz
Open Source software and tech docs Insanity Palace of Metallica
http://www.phildev.net/ http://www.ipom.com/
"Be who you are and say what you feel, because those who mind don't matter
and those who matter don't mind."
- Dr. Seuss
Attachment:
signature.asc
Description: OpenPGP digital signature
Archive powered by MHonArc 2.6.16.