Thursday, June 10, 2021

working with ansible-pyats cannot get show bgp all neighbors xx.xx.xx.xx advertised-routes

I am not sure i am getting the syntax right but I want to get the advertised-routes out of a router in structured data.

playbook: (note this is in a home lab)

---
- name: Show bgp adv routes
hosts: ios-router
connection: network_cli
gather_facts: no
roles:
    - ansible-pyats
tasks:
    - pyats_parse_command:
command: show bgp all neighbors 10.250.150.10 advertised-routes

register: output
    - debug:
var: output.structured

output:

TASK [pyats_parse_command] *********************************************************************************************************************************************

fatal: [192.168.86.211]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "msg": "Unable to parse output for command 'show bgp all neighbors 10.250.150.10 advertised-routes' ('Device' object has no attribute 'execute')"}

command does have output on a router, and I can use something like 'show ip route' and get structured data but I need the advertised routes.

thanks!



No comments:

Post a Comment