Thank you Vladimir. I will try in to add in my script and try. Thanks again a lot On Friday, May 28, 2021 at 9:14:35 PM UTC+5:30 [email protected] wrote:
> On Fri, 28 May 2021 08:21:43 -0700 (PDT) > "R.B. Kumar" <[email protected]> wrote: > > > ... where the lines you shown here will fit in my script. My > > script is below > > > > - name: get_ip > > ios_command: > > provider: "{{ cli }}" > > commands: "show ip interface brief {{ item }}" > > register: var_ip_addr > > - 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() }}" > > - debug: > msg: "{{ interfaces[item] }}" > loop: > - GigabitEthernet0/0/0 > - Loopback0 > > gives > > msg: 42.151.182.42 > msg: 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/552631d0-3a4d-4b54-8f72-11e4aa673979n%40googlegroups.com.
