Note that this behavior is intentional:Also, knockouts will most likely be removed from Chef 11.0. See:--Daniel DeLeoOn Tuesday, September 4, 2012 at 4:14 PM, Juanje Ojeda Croissier wrote:
Yes, I'm running 10.12.0, but I did it with a role. Maybe that's it.On Wed, Sep 5, 2012 at 12:02 AM, Michael Glenney < " target="_blank"> > wrote:Hmm. You're running 10.12.0? I just tested again. Started with thefollowing:Node data (with 'knife node show <nodename> -Fj'):"haproxy": {"config": "classroom.cfg.erb","nodes": {"portal_api": ["2.2.2.2","3.3.3.3"]}haproxy config:server portal_api-2.2.2.2 2.2.2.2:443 check port 443 inter 10s rise 4 fall4server portal_api-3.3.3.3 3.3.3.3:443 check port 443 inter 10s rise 4 fall4I ran 'chef-client -j /etc/chef/routing_rules.json' with the following in"routing_rules.json":{ "haproxy": { "nodes": { "portal_api": [ "!merge:", "10.10.10.10","11.11.11.11" ] } } }This is what I ended up with:Node data:"haproxy": {"config": "classroom.cfg.erb","nodes": {"portal_api": ["2.2.2.2","3.3.3.3","!merge:","10.10.10.10","11.11.11.11"]}haproxy config:server portal_api-2.2.2.2 2.2.2.2:443 check port 443 inter 10s rise 4 fall4server portal_api-3.3.3.3 3.3.3.3:443 check port 443 inter 10s rise 4 fall4server portal_api-!merge: !merge::443 check port 443 inter 10s rise 4 fall4server portal_api-10.10.10.10 10.10.10.10:443 check port 443 inter 10srise 4 fall 4server portal_api-11.11.11.11 11.11.11.11:443 check port 443 inter 10srise 4 fall 4The docs say you can run without the colon now but I'm not seeing adifference. Doesn't work either way.MGOn Tue, Sep 4, 2012 at 3:41 PM, Juanje Ojeda Croissier< " target="_blank"> > wrote:
I believe the issue here is the " (without the colon) ". I had sometroubles here as well, but it's now working with the colon("!merge:").Could you test it with colon, please?On Tue, Sep 4, 2012 at 8:27 PM, Michael Glenney < " target="_blank"> >wrote:I have now verified that putting !merge does not work in 10.12.0 I'llgoback an read over the link AJ sent again but it appears as if deep mergeisgone or broken.Here's the json I passed to the chef-client run:
{ "haproxy": { "nodes": { "portal_api": [ "!merge", "4.4.4.4", "5.5.5.5"] }} }Here's the resulting haproxy config:server portal_api-!merge !merge:443 check port 443 inter 10s rise 4fall 4server portal_api-4.4.4.4 4.4.4.4:443 check port 443 inter 10s rise 4fall4server portal_api-5.5.5.5 5.5.5.5:443 check port 443 inter 10s rise 4fall4Not what I was going for obviously.MGOn Sun, Sep 2, 2012 at 6:46 PM, Michael Glenney < " target="_blank"> >wrote:Yeah. Looking at your link it looks like using "!merge" (without thecolon) will probably work. just need to test it. That goes along withwhatit says in the wiki except for the fact that the wiki says it "can" beusedinstead of saying it must.MGOn Sun, Sep 2, 2012 at 3:11 PM, AJ Christensen < " target="_blank"> >wrote:From DeepMerge mixin class:# Inherited roles use the knockout_prefix array subtractionfunctionality# This is likely to go away in Chef >= 0.11def 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})endMaybe there's something useful for you here.I've only once used the attribute knockout functionality -- what isyour use case? There may be another simple solution.--AJOn 3 September 2012 09:08, Michael Glenney < " target="_blank"> >wrote:Weird. For some reason it's not sending me my own. Oh well. Havetherebeen any responses to my question? Because I dont see any of thoseeitherMichael GlenneySent from my iPhoneOn Sep 2, 2012, at 11:43 AM, Adam Jacob < " target="_blank"> > wrote:Nope - I saw it two days ago.AdamOn Sun, Sep 2, 2012 at 10:04 AM, Michael Glenney< " target="_blank"> > wrote:I sent this on friday. Still hasn't made it to my inbox. Am Igettingmoderated?Michael GlenneySent from my iPhone
On Aug 31, 2012, at 4:08 PM, Michael Glenneywrote:I had a problem with deep merge not working properly in 10.12.0.Tested in0.10.10 and it didn't work there either. Instead of replacing myarray itwas actually putting "!merge:" into my array.After I reverted to 0.10.4 to get my deployment completed Istumbledon this"!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 waituntilMonday.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--Juanje--Juanje
Archive powered by MHonArc 2.6.16.