[chef] Re: attributes inheritance


Chronological Thread 
  • From: Cassiano Leal < >
  • To: < >
  • Cc:
  • Subject: [chef] Re: attributes inheritance
  • Date: Mon, 22 Jul 2013 14:45:53 -0300

I’m not sure I understand your problem, but at first sight it seems like you could use node.set in the recipes:


attributes/default.rb

  default["myapp"]["conf"] = "XXX"

  default["myapp"]["truc"] = "YYY"


recipes/part1.rb
  node.set[“myapp”][“conf”] = XXX1

recipes/part2.rb
  node.set[“myapp”][“conf”] = XXX2

--
Cassiano Leal
http://cassianoleal.com
http://twitter.com/cassianoleal

On July 22, 2013 at 14:16:26, Dorian Jaminais ( ) wrote:

Ohai Chefs !

Is there a way in an attribute file to reuse attributes from another file ?

Here is my use case :
I have an application split in two components, each requiring its configuration.
Most of thetime the configuration of both will be identical but this may not be always true.
For this reason I'd like to define 'default' attributes in the default attribute file and then have one attribute file per part of my application. Atribute would be organized this way :
default.rb
  default["myapp"]["conf"] = "XXX"
  default["myapp"]["truc"] = "YYY"
part1.rb
  default["myapp"]["part1"]["conf"] = "XXX1"
  #default["myapp"]["part1"]["truc"] = "YYY" < I want it to default to this value when not explicitly set
part2.rb
  default["myapp"]["part2"]["conf"] = "XXX2"

Is there a way to achieve this ?
At the moment I am using global variable to pass information from one file to the other but this seams ugly to me.

--
Dorian JAMINAIS
System Administrator
+33 6 95 10 95 37






Archive powered by MHonArc 2.6.16.

§