Re: [ansible-project] Combine dictionaries based on a dictionary key value.

2020-07-01 Thread Vladimir Botka
On Tue, 30 Jun 2020 10:00:14 +0200 "'Felix Fontein' via Ansible Project" wrote: > a new lookup plugin was proposed for community.general which would help > with this: > https://github.com/ansible-collections/community.general/pull/263 I have proposed this filter plugin instead

Re: [ansible-project] Combine dictionaries based on a dictionary key value.

2020-06-30 Thread 'Felix Fontein' via Ansible Project
Hi, a new lookup plugin was proposed for community.general which would help with this: https://github.com/ansible-collections/community.general/pull/263 We're currently trying to evaluate whether this plugin would be useful to the community. Feel free to comment there (or try it out!). Cheers,

Re: [ansible-project] Combine dictionaries based on a dictionary key value.

2020-06-30 Thread Vladimir Botka
On Mon, 29 Jun 2020 13:22:05 -0700 (PDT) Adam McGill wrote: > add the items of net_interface into aggregate_info or > create new dictionary based on key value of node_name. Create dictionaries from the lists - set_fact: agg: "{{ agg|default({})|combine({item.node_name: item}) }}"

Re: [ansible-project] Combine dictionaries based on a dictionary key value.

2020-06-30 Thread Vladimir Botka
On Mon, 29 Jun 2020 13:22:05 -0700 (PDT) Adam McGill wrote: > ... add the items ... based on key value of node_name. > > aggregate_info: [ > { >... >"node_name": "TEST_NA_CLUSTER_01-01", >... > }, > { >... >"node_name": "TEST_NA_CLUSTER_01-02", >... > }] > >

[ansible-project] Combine dictionaries based on a dictionary key value.

2020-06-29 Thread Adam McGill
Hello, Basically want to add the items of net_interface into aggregate_info or create new dictionary based on key value of node_name. Looking for assistance on how i can achieve this please and thank you. *Dictionary called: aggregate_info* { "name": "agg_Data1_Cluster01", "node_name":