In my chef recipe, I have a bash ruby block. I need some value generated from it passed to my templates. For example, the joke
variable in here:
bash "create opal user" do
code <<-EOH
joke='my funny joke'
echo $joke
EOH
end
template '/joke.txt' do
source 'joke.txt.erb'
variable(joke:"#{joke}")
end
Answered in IRC, Chef doesn't work like this in general. The shell_out helper can sometimes be used but overall you should try to not structure your recipes this way.