Hi,node.override['k'] = v
I am using chef-solo and I am trying to use data bags as a way of controlling some external environment data.
My workflow dictates that all cookbooks are stored in one git repository and I tag production releases.
To remove sensitive and changeable env data from this repository, I have moved certain attributes into data bags and at run time I am loading those data bags from a directory in the solo config file.
I am trying to merge the data bag attributes into node attributes in a recipe doing the following:
------
envdata = data_bag_item("databag", "env-json-file")
envdata.each do |k,v|end
--------
where my data bag is like this:
------
{
"id": "env-json-file",
"cookbook_name": {
"memcache": {
"servers": [
"server1:11211",
"server2:11211"
]
}
}
}
-------
I would expect node['cookbook_name']['memcache']['servers'] to have become the above array, but I am still finding the default attribute from the cookbook to be the value used.
Have I missed something fundamental in how attributes are merged, especially if they are several layers deep in a Hash?
Thanks,
Tom
George Miranda — Consulting
512.481.2876 – " style="color:rgb(105,117,130)" target="_blank"> – Linkedin Twitter
| ||
Archive powered by MHonArc 2.6.16.