103 lines
2.6 KiB
YAML
103 lines
2.6 KiB
YAML
|
---
|
||
|
- debug:
|
||
|
msg: "Start eos_static_routes merged integration tests ansible_connection={{ ansible_connection }}"
|
||
|
|
||
|
- include_tasks: _populate.yaml
|
||
|
|
||
|
- set_fact:
|
||
|
config:
|
||
|
- address_families:
|
||
|
- afi: ipv4
|
||
|
routes:
|
||
|
- dest: 10.1.1.0/24
|
||
|
next_hops:
|
||
|
- interface: Management1
|
||
|
- admin_distance: 200
|
||
|
forward_router_address: 20.1.1.3
|
||
|
interface: Ethernet1
|
||
|
track: bfd
|
||
|
- dest: 10.50.0.0/16
|
||
|
next_hops:
|
||
|
- interface: Management1
|
||
|
- dest: 23.1.0.0/16
|
||
|
next_hops:
|
||
|
- nexthop_grp: testgrp
|
||
|
tag: 42
|
||
|
- dest: 155.55.1.0/24
|
||
|
next_hops:
|
||
|
- nexthop_grp: testgrp
|
||
|
tag: 100
|
||
|
- afi: ipv6
|
||
|
routes:
|
||
|
- dest: 1000:10::/64
|
||
|
next_hops:
|
||
|
- admin_distance: 67
|
||
|
interface: Ethernet1
|
||
|
tag: 98
|
||
|
- address_families:
|
||
|
- afi: ipv4
|
||
|
routes:
|
||
|
- dest: 77.77.1.0/24
|
||
|
next_hops:
|
||
|
- interface: 33.1.1.1
|
||
|
vrf: vrftest1
|
||
|
- address_families:
|
||
|
- afi: ipv4
|
||
|
routes:
|
||
|
- dest: 120.1.1.0/24
|
||
|
next_hops:
|
||
|
- admin_distance: 23
|
||
|
interface: Ethernet1
|
||
|
- afi: ipv6
|
||
|
routes:
|
||
|
- dest: 1120:10::/64
|
||
|
next_hops:
|
||
|
- admin_distance: 55
|
||
|
interface: Ethernet1
|
||
|
vrf: testvrf
|
||
|
|
||
|
- name: merge attributes of given static routes.
|
||
|
eos_static_routes: &merged
|
||
|
config:
|
||
|
- vrf: "testvrf"
|
||
|
address_families:
|
||
|
- afi: 'ipv6'
|
||
|
routes:
|
||
|
- dest: '1120:10::/64'
|
||
|
next_hops:
|
||
|
- interface: Ethernet1
|
||
|
admin_distance: 55
|
||
|
- address_families:
|
||
|
- afi: 'ipv4'
|
||
|
routes:
|
||
|
- dest: '155.55.1.0/24'
|
||
|
next_hops:
|
||
|
- nexthop_grp: testgrp
|
||
|
tag: 100
|
||
|
state: merged
|
||
|
become: yes
|
||
|
register: result
|
||
|
|
||
|
- eos_facts:
|
||
|
gather_network_resources: static_routes
|
||
|
become: yes
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- "ansible_facts.network_resources.static_routes|symmetric_difference(config) == []"
|
||
|
- '"ipv6 route vrf testvrf 1120:10::/64 Ethernet1 55" in result.commands'
|
||
|
- '"ip route 155.55.1.0/24 Nexthop-Group testgrp tag 100" in result.commands'
|
||
|
become: yes
|
||
|
|
||
|
- name: Idempotency check
|
||
|
eos_static_routes: *merged
|
||
|
become: yes
|
||
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- "result.changed == false"
|
||
|
- "result.commands|length == 0"
|
||
|
|
||
|
- include_tasks: _remove_config.yaml
|