- Create a new playbook called pb_net_validate.yml and add the following task to store all SVI IP addresses:
---
- name: "PLay 1: Validate Network Reachability"
hosts: core,wan
vars:
host_id: 10
packet_count: 10
tasks:
- name: "Get all SVI Prefixes"
set_fact:
all_svi_prefixes: "{{ svi_interfaces | selectattr('vrrp') |
map(attribute='ipv4') | list }}"
run_once: yes
delegate_to: localhost
tags: svi
- Update the pb_net_validate.yml playbook with the following task to ping all the SVI interfaces:
- name: "Ping Hosts in all VLANs"
ios_ping:
dest: "{{ item | ipaddr(10) | ipaddr('address') }}"
loop: "{{ all_svi_prefixes }}"
ignore_errors: yes
tags: svi