Not really. Python doesn't allow to merge two hashes using "{{ env1 + env2
}}". Here's what worked for me:
playbooks/filter_plugins/filters.py:
------------------------------------------------
def merge( hash_a, hash_b ):
return dict(hash_a.items() + hash_b.items());
class FilterModule( object ):
def filters( self ):
return { 'merge' : merge }
------------------------------------------------
and then:
environment: "{{ env1 | merge( env2 ) }}"
On Friday, August 1, 2014 3:14:11 PM UTC+2, Michael DeHaan wrote:
>
> So that's a thing already with {{ dict1 + dict2 }}?
>
> Nice.
>
>
>
>
> On Fri, Aug 1, 2014 at 8:53 AM, Brian Coca <[email protected]
> <javascript:>> wrote:
>
>> dict1 + dict2
>>
>> I also have an update to 'set theory' that will allow you to do
>> dict1|union(dict2)
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CADn%2BHswCwhz%2B7c%2Bn8f2jdRm0-1%2BDjp6Rqrt%2BgYyXThTauGfMNg%40mail.gmail.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/CADn%2BHswCwhz%2B7c%2Bn8f2jdRm0-1%2BDjp6Rqrt%2BgYyXThTauGfMNg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5bbe2eda-80db-438a-b5a8-0eef1561df98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.