[chef] Re: Re: Re: Re: Updating a template


Chronological Thread 
  • From: Kenneth Barry < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Updating a template
  • Date: Wed, 26 Mar 2014 13:32:23 -0700

knife cookbook show COOKBOOK VERSION shows me the mdf hash of the old template file, which happens to be the same file obtained when downloading the cookbook.
I deleted all versions of the cookbook from the chef server so its only offering one for download.

in plain terms
it was version 1.0.0(example), and i noticed the template wasn't changing (as in, the file created by templates isnt different), so i change it to 1.0.1, deleted the cookbook "1.0.0" from the server, and uploaded new version. 

same results (template appears to be the old one still), 

I downloaded the cookbook from server, and it downloaded the old template file, not the new one)

it appears, by all indications, that the chef server is retaining the old tempalte, even thru a knife cookbook delete, 


On Wed, Mar 26, 2014 at 1:16 PM, Daniel DeLeo < " target="_blank"> > wrote:
On Wednesday, March 26, 2014 at 12:56 PM, Kenneth Barry wrote:
> "First of all, did you change the cookbook’s version?"
> Yes, I changed the version of the cookbook
>
> " If so, you should check which version was downloaded to the client. "
> i don't know how to see what version was downloaded to the client (do you mean Node?), but what I do know if when i download from the chef server "knife cookbook download [name]" I get the old template file (containing the old content)

The most straightforward way to see what version is on a node is to look at the metadata file in the cache directory.

Also, have you uploaded with the `-VV` option and inspected the output? In particular, you’ll see lines like this:

DEBUG: /Users/ddeleo/oc/all_cookbooks/mysql/templates/default/grants.sql.erb has not changed

Do you get such a line for your template?

Also, with `knife cookbook show COOKBOOK VERSION`, you get the raw data the server stores about the cookbook, including md5s of each of the files and pre-signed URLs to download them. Can you check whether these pertain to the new or old files?

Finally, do you have more than one directory configured as your cookbook_path, and is there a version of the cookbook in more than one of these directories?

>
> "If chef-client is downloading a different version than you expected, it could be caused by "
>
>
> "dependency constraints in your environment or in other cookbooks,"
> we are not using any constraints in our environments. period.

Dependency contraints in cookbooks will be honored, so the dependency solver still needs to get the set of cookbooks that honor those constraints even if there’s nothing in your environments.


--
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§