On Mon, 29 Jun 2020 13:22:05 -0700 (PDT)
Adam McGill <adamande...@gmail.com> 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}) }}"
      loop: "{{ aggregate_info }}"
    - set_fact:
        net: "{{ net|default({})|combine({item.node_name: item}) }}"
      loop: "{{ net_interface }}"

Then combine the corresponding dictionaries and concatenate the results into
a new list

    - set_fact:
        aggregate_info2: "{{ aggregate_info2|default([]) +
                             [agg[item]|combine(net[item])] }}"
      loop: "{{ agg.keys()|list }}"



Vladimir Botka

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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Attachment: pgpRSYG5kbvFs.pgp
Description: OpenPGP digital signature

Reply via email to