- From: Zuhaib Siddique <
>
- To:
- Subject: [chef] Re: Re: Issues with Template Files after upgrading to Chef 10.6
- Date: Wed, 14 Dec 2011 23:55:43 -0800
Actually the environment variable is not the chef environment, its something
set earlier up (this was used prior to Chef 10 and I have not converted
over). I just decided to go with mkdir_p because its what I knew but even if
I switch to directory it still does not make sense why its refusing to create
the template in that directory but its ok in any other.
On Dec 14, 2011, at 8:47 PM, Adam Jacob wrote:
>
I see a bug in your code - environment should probably be
>
node.chef_environment == "int_environment"?
>
>
Adam
>
>
---
>
Opscode, Inc.
>
Adam Jacob, Chief Customer Officer
>
T: (206) 619-7151 E:
>
>
>
On Dec 14, 2011, at 8:40 PM, Zuhaib Siddique wrote:
>
>
> So for some reason the following block of code stop working in Chef 10.6
>
> on a ubuntu server:
>
>
>
> template "/tmp/oxygen/properties.map" do
>
> source "INT.properties.map.erb"
>
> owner "root"
>
> group "root"
>
> mode 0644
>
> variables(
>
> :webname => node[:hostname],
>
> :mysql_password => "#{mysql_pass}",
>
> :data_db => "DB_Host",
>
> :rs_db => "DB_HOST",
>
> :weblink => "URL"
>
> )
>
> only_if {environment == "int_environment"}
>
> end
>
>
>
> but if I change the following:
>
>
>
> template "/tmp/properties.map" do
>
>
>
> it starts working. Now the folder its uploaded too is created by chef:
>
>
>
> FileUtils.mkdir_p("/tmp/oxygen/")
>
>
>
> But on the system I am testing the recipe on I made the directory manually
>
> yet still it won't upload the file. From the log it looks like it just
>
> skips over template like the if condition does not match but thats not the
>
> case. The weird thing is on another system that has 10.4 installed it
>
> works as expected. The only change has been upgraded to 10.6 on my
>
> personal system that I run knife on (and in turn the new systems get 10.6).
>
>
>
> Zuhaib
>
Archive powered by MHonArc 2.6.16.