[chef] Re: using variables in recipes?


Chronological Thread 
  • From: Alex Vinyar < >
  • To:
  • Subject: [chef] Re: using variables in recipes?
  • Date: Sun, 27 Apr 2014 20:06:56 -0700

Hi, 

you can use Ohai variable node['hostname'] or environment variable via ENV['something'].

Damn Eric beat me to it..

in terminal open up chef-shell. It'll allow you to experiment without having to execute the whole recipe.

Cheers
Alex-

On Sun, Apr 27, 2014 at 7:58 PM, Tomasz Chmielewski < " target="_blank"> > wrote:
How can I use the $HOSTNAME variable in a recipe?

I need something which would fit here:

remote_file "/tmp/$HOSTNAME.tar.xz" do
  source "https://user: :port/aaa/$HOSTNAME.tar.xz"
  owner "root"
  group "root"
  mode 00600
  not_if { ::File.exists?("/some/path/here") }
end


--
Tomasz Chmielewski
http://wpkg.org




Archive powered by MHonArc 2.6.16.

§