ansible-network / cisco_ios

Ansible Network Cisco IOS Provider Role
GNU General Public License v3.0
81 stars 51 forks source link

show ip bgp sum should always be a list #76

Open IPvSean opened 5 years ago

IPvSean commented 5 years ago

with respect to: https://github.com/ansible-network/cisco_ios/blob/devel/parser_templates/cli/show_ip_bgp_summary.yaml

I feel like the output of show ip bgp summary should always be a list using the filter

here is my output

ok: [rtr2] => changed=false
  ansible_facts:
    cisco_ios:
      vrf:
        DEFAULT:
          protocols:
            bgp:
              neighbors:
                172.17.124.126:
                  asn: '65004'
                  ip_version: '4'
                  state_pfxrcd: '0'
                  timer: 04:31:33
              process_state: active
  included:
  - /home/student1/.ansible/roles/ansible-network.cisco_ios/parser_templates/cli/show_ip_bgp_summary.yaml

otherwise trying to print out the neighbor info for multiple vs one is different and you got to have logic in the playbook for that

LukeDRussell commented 5 years ago

In my playbooks I use the jinja list filter to iterate, which I think proves your point.