[chef] Re: param[:name] bizarreness when nesting defines


Chronological Thread 
  • From: Matthias Marschall < >
  • To:
  • Subject: [chef] Re: param[:name] bizarreness when nesting defines
  • Date: Wed, 19 Jan 2011 10:53:58 +0100

I can confirm that issue. Here is what failed for us:

iptables_rule "mysql_internal" do
  variables :mysql_ip => internal_ip(node)
end

It works, if I do it like this:

mysql_ip = internal_ip(node)
iptables_rule "mysql_internal" do
  variables :mysql_ip => mysql_ip
end

Can anyone shed any light on this one? It's an ugly pitfall

- Matthias


> I have my local runit recipe patched to configure svlogd-emitted log files 
> as sources for remote logging. The obvious implementation is such:
> 
>   logged_file "#{sv_dir_name}/log/main/current" do
>     tag "sv-#{params[:name]}"
>   end
> 
> However, when doing so, the tag gets instantiated as "sv-"
> 
> If, however, I do the following:
> 
>   sv_name = params[:name]
>   logged_file "#{sv_dir_name}/log/main/current" do
>     tag "sv-#{sv_name}"
>   end
> 
> all works properly.
> 
> WTF?!




Archive powered by MHonArc 2.6.16.

§