[chef] Re: Re: Re: Re: Re: Deep merge in 0.10.10 and 10.12.0


Chronological Thread 
  • From: Michael Glenney < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Deep merge in 0.10.10 and 10.12.0
  • Date: Sun, 2 Sep 2012 18:37:03 -0700

They are IP addresses to build a load balancer template.  When new nodes get stood up I kick out a json of that attribute with [ "!merge:", "1.1.1.1", "2.2.2.2" ] as it's value, run chef-client with that json, and the load balancer config is rewritten with the new nodes in, old nodes out.

MG

On Sun, Sep 2, 2012 at 3:11 PM, AJ Christensen < " target="_blank"> > wrote:
From DeepMerge mixin class:

# Inherited roles use the knockout_prefix array subtraction functionality
# This is likely to go away in Chef >= 0.11
      def role_merge(first, second)
        first  = Mash.new(first)  unless first.kind_of?(Mash)
        second = Mash.new(second) unless second.kind_of?(Mash)

        DeepMerge.deep_merge(second, first, {:knockout_prefix =>
"!merge", :preserve_unmergeables => false})
      end

https://github.com/opscode/chef/blob/master/chef/lib/chef/mixin/deep_merge.rb#L44

Maybe there's something useful for you here.

I've only once used the attribute knockout functionality -- what is
your use case? There may be another simple solution.

--AJ

On 3 September 2012 09:08, Michael Glenney < "> > wrote:
> Weird. For some reason it's not sending me my own. Oh well.  Have there been any responses to my question?  Because I dont see any of those either
>
> Michael Glenney
> Sent from my iPhone
>
> On Sep 2, 2012, at 11:43 AM, Adam Jacob < "> > wrote:
>
>> Nope - I saw it two days ago.
>>
>> Adam
>>
>> On Sun, Sep 2, 2012 at 10:04 AM, Michael Glenney < "> > wrote:
>>> I sent this on friday. Still hasn't made it to my inbox. Am I getting
>>> moderated?
>>>
>>> Michael Glenney
>>> Sent from my iPhone
>>>
>>> On Aug 31, 2012, at 4:08 PM, Michael Glenney < "> > wrote:
>>>
>>> I had a problem with deep merge not working properly in 10.12.0.  Tested in
>>> 0.10.10 and it didn't work there either.  Instead of replacing my array it
>>> was actually putting "!merge:" into my array.
>>>
>>> After I reverted to 0.10.4 to get my deployment completed I stumbled on this
>>> line from http://wiki.opscode.com/display/chef/Deep+Merge:
>>>
>>> "!merge (without the colon) can be used in Chef >= 0.10.10"
>>>
>>> I haven't had a chance to go back and test.  Will have to wait until Monday.
>>> But should that line read:
>>>
>>> "!merge (without the colon) MUST be used in Chef >= 0.10.10"
>>>
>>> Thanks,
>>>
>>> MG
>>
>>
>>
>> --
>> Opscode, Inc.
>> Adam Jacob, Chief Customer Officer
>> T: (206) 619-7151 E: ">




Archive powered by MHonArc 2.6.16.

§