-------- Original Message --------
Subject: [chef] Re: template question
From: Ash Berlin < "> >
Date: Mon, December 05, 2011 12:16 pm
To: ">
:pete => node[:domain] == "foo.com" > "bar" : "baz"orpete = case node[:domain]when "foo.com""foo"when /bar\.com$/"bar_and_sub"endvariables({..., :pete => pete})Untested but approximately that. It helps if you realise that this is Just Ruby (helps me anyway. Also helps here if you know ruby, mind.)-ashI have a templatetemplate "/etc/djo.dat" dosource "djo.dat.erb"mode 0644owner "root"group "root"variables({:domain => node[:domain],:pete => "jimmy"})endI want pete = to different fixed values based on node[:domain]what is the best way to do this?
Archive powered by MHonArc 2.6.16.