[chef] Re: Re: Re: Environment Inheritence


Chronological Thread 
  • From: Ranjib Dey < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: Environment Inheritence
  • Date: Thu, 18 Jun 2015 15:16:09 -0700

sure:

https://gist.github.com/ranjib/2f7e1482a3ac8f6e5bfc







On Thu, Jun 18, 2015 at 3:05 PM, Torben Knerr < " target="_blank"> > wrote:

Hey Ranjib,

mind sharing an example snippet on how you do that?

Thought that includes were not possible with json environment files, but yes, indeed they can be ruby dsl as well...

Cheers, Torben

Am 18.06.2015 22:30 schrieb "Ranjib Dey" < " target="_blank"> >:
i use environment heavily as well, and face the same problem. The trick i use is have a environments/common folder which container coomon things in yaml file (or ruby if you like) that is just data. Top level environments (say environments/foo.rb) can directly read that yaml, and deep_merge! (one of dans many awesome works :-) ) that directly in default_attributes method. this allows me to keep the common data and reuse it.,

hope that helps.

On Thu, Jun 18, 2015 at 10:48 AM, Douglas Garstang < " target="_blank"> > wrote:
All,

I'm making pretty heavy use of environments. There's quite a fair bit of duplication and I'd like to implement a 'base' environment, with common attributes that apply to all environments. How would I do this?

What happens if the same attribute is defined in multiple environments? Are they merged together or does the 'inherited' one override the 'base' one?

Thanks,
Doug







Archive powered by MHonArc 2.6.16.

§