- From: "Michael L." <
>
- To:
- Subject: [chef] Template Variable as a Hash
- Date: Wed, 21 Aug 2013 14:34:43 +0300
Greetings !
I am trying to pass a Hash as a variable to the Template like this:
==================================
params = {'key1' => 'val1', 'key2' => 'val2'}
template "/etc/test.conf" do
mode 0640
variables(
:params => params
)
end
==================================
My Template looks like this:
==================================
..
params = <%= @params.each_pair {|k,v| print "#{k}=#{v} "} %>
..
==================================
But this doesn't work, giving the errors on the compile time:
==================================
..
(erubis):84: syntax error, unexpected tIDENTIFIER, expecting ')'
(erubis):90: syntax error, unexpected tIDENTIFIER, expecting ')'
..
==================================
Please advise.
Thanks !
Archive powered by MHonArc 2.6.16.