net_neighbors

15 views
Skip to first unread message

Jaime Jaca

unread,
Sep 3, 2020, 3:00:08 AM9/3/20
to Ansible Project
I would like to filter the neighbors to only show switches and routers

Dick Visser

unread,
Sep 3, 2020, 6:04:10 AM9/3/20
to ansible...@googlegroups.com
Playbooks, examples, etc will help in getting an answer with so little context

On Thu, 3 Sep 2020 at 09:00, Jaime Jaca <jaim...@gmail.com> wrote:
I would like to filter the neighbors to only show switches and routers








--


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-proje...@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/41eb1bd4-7779-4694-bd6b-14f0047dc71bn%40googlegroups.com.


--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Jaime Jaca

unread,
Sep 3, 2020, 6:25:50 AM9/3/20
to Ansible Project
With this playbook it shows the ports and the neighbors connected by cdp or lldp (sw, routers, telephones, aps ..). I would like it to only show sw and routers.


  tasks:
     - name: GATHER FACTS FOR IOS IN A TASK
       ios_facts:

     - name: VIEW ALL ANSIBLE FACT KEYS
       debug:
         var: ansible_facts.keys()

     - name: View HOSTNAME
       debug:
         var: ansible_net_hostname

     - name: View Neighbors
       debug:
         var: ansible_net_neighbors
Reply all
Reply to author
Forward
0 new messages