Test-kitchen: extend configuration with json attributes?


#1

Ohai Chefs,

would it make sense to add json attributes to the cookbook configuration?

e.g. if you want to override some node attributes, it could be done like so:

“”"
chef_json = {
:apache => {
:'listen_ports => [“123”]
}
}

cookbook “apache2” do
configuration “apache_on_different_port”, chef_json
end
"""

Within the Vagrantfile the passed json would then be merged into chef.json:
https://github.com/opscode/test-kitchen/blob/master/config/Vagrantfile#L100

Or would node.set['apache']['listen_ports'] = ['123'] within the
"apache_on_different_port.rb" configuration recipe be the preferred
way to do this?

I could imagine that this might lead to different results depending on
the ordering of recipes, but I’m not sure. What do you guys think?

Cheers,
Torben


#2

Hey guys,

I would love to hear how you are handling this currently.

Anyways I have created http://tickets.opscode.com/browse/KITCHEN-21 in
the meanwhile.

Cheers,
Torben

On Mon, Aug 20, 2012 at 10:04 AM, Torben Knerr ukio@gmx.de wrote:

Ohai Chefs,

would it make sense to add json attributes to the cookbook configuration?

e.g. if you want to override some node attributes, it could be done like so:

“”"
chef_json = {
:apache => {
:'listen_ports => [“123”]
}
}

cookbook “apache2” do
configuration “apache_on_different_port”, chef_json
end
"""

Within the Vagrantfile the passed json would then be merged into chef.json:
https://github.com/opscode/test-kitchen/blob/master/config/Vagrantfile#L100

Or would node.set['apache']['listen_ports'] = ['123'] within the
"apache_on_different_port.rb" configuration recipe be the preferred
way to do this?

I could imagine that this might lead to different results depending on
the ordering of recipes, but I’m not sure. What do you guys think?

Cheers,
Torben