For example

    - set_fact:
        interfaces: "{{ interfaces|default({})|
                        combine({_arr.0: _arr.1}) }}"
      loop: "{{ var_ip_addr.results|
                json_query('[].stdout_lines') }}"
      vars:
        _arr: "{{ item.0.1.split() }}"

should give

  interfaces:
    GigabitEthernet0/0/0: 42.151.182.42
    Loopback0: 172.31.246.246


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20210528161301.2962e64d%40gmail.com.

Attachment: pgpd4m2GREtRM.pgp
Description: OpenPGP digital signature

Reply via email to