[chef] Re: using variables in recipes?


Chronological Thread 
  • From: "Wolfe, Eric G" < >
  • To: " " < >
  • Subject: [chef] Re: using variables in recipes?
  • Date: Mon, 28 Apr 2014 03:04:41 +0000
  • Accept-language: en-US

You can interpolate the ohai hostname attribute like so: "#{node['hostname']}"

Tomasz Chmielewski 
< >
 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.

§