Help with attributes



I’m having some issues with attributes, my values are changing at
random after each chef-client run.
Let me explain it a little more:

I have a cookbook for “tomcat”, this cookbook drops a file in
/etc/tomcat6/server.xml using a template. The attributes file of this
cookbook contains nothing relevant to this file.

I have another cookbook for one of the apps that we deploy in tomcat,
this cookbook includes the ‘tomcat’ cookbook and it has the following
set in the attributes:
default[:tomcat][:default_host] = '
default[:tomcat][‘vhosts’][‘’][‘app’] = 'dev’
default[:tomcat][‘vhosts’][‘’][‘base’] = 'dev’
default[:tomcat][‘vhosts’][‘’][‘path’] = ‘/’

I then have another cookbook for yet another app that we deploy in
tomcat, this cookbook is similar to the above and it sets the
following in its attributes:
default[:tomcat][‘vhosts’][‘’][‘app’] = 'otherapp’
default[:tomcat][‘vhosts’][‘’][‘base’] = 'optherapp’
default[:tomcat][‘vhosts’][‘’][‘path’] = ‘/’

Now on a particular environment I include both those cooks (which
ultimately call the tomcat one) and I then try override all those
settings with the following JSON in the node file:
{ “normal” : {
“tomcat” : {
“default_host” : “”,
“vhosts” : {” : { “app” : “prod”, “base” : “prod”,
“path” : “/” }

In my head this should work, my server.xml file should be populated
with the stuff in the JSON as they are set as “normal” and this should
take preference over the “default” attributes.
However, after every chef-client run I get a different result.
Sometimes the file is as I expect it, other times the default_host has
changed to “”, other times I have “”,” and “” all in the file.

Every time I run chef-client the file changes.

Any idea what I’m doing wrong?