[chef] Array attributes merge


Chronological Thread 
  • From: "aL." < >
  • To:
  • Subject: [chef] Array attributes merge
  • Date: Mon, 21 Oct 2013 13:22:14 +0100

Array attributes are merged, i have checked out that this is the behaviour when using default attributes on attribute files and roles.

But when i try to define a default attribute on one recipe:

node.default['foo'] = ['bar']

The one that i have already on defaults.rb attribute file:

node.default['foo'] = ['littlebar']

Is overrided by the one i defined on the recipe, resulting node['foo'] = ['bar']

Defining on  a role:

default_attributes (:foo => ['bar'])

Works as expected, and results on node['foo']  = ['littlebar','bar']

So what exactly node.default['x'] = value do on recipes? Looks like a direct override... O_o

--
Si necesitas una máquina para hacer algo y no la compras al final te darás cuenta de que has pagado lo mismo y no tienes la máquina.--Henry Ford
Alberto



Archive powered by MHonArc 2.6.16.

§