3405ee1c01
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
73 lines
2.3 KiB
YAML
73 lines
2.3 KiB
YAML
---
|
|
- debug:
|
|
msg: "START iosxr_static_routes round trip integration tests on connection={{ ansible_connection }}"
|
|
|
|
- block:
|
|
- include_tasks: _remove_config.yaml
|
|
|
|
- name: Apply the provided configuration (base config)
|
|
iosxr_static_routes:
|
|
config:
|
|
- address_families:
|
|
- afi: ipv4
|
|
safi: unicast
|
|
routes:
|
|
- dest: 192.0.2.48/28
|
|
next_hops:
|
|
- forward_router_address: 192.0.2.15
|
|
admin_distance: 105
|
|
track: ip_sla_2
|
|
- vrf: DEV_SITE
|
|
address_families:
|
|
- afi: ipv6
|
|
safi: unicast
|
|
routes:
|
|
- dest: 2001:db8:3000::/36
|
|
next_hops:
|
|
- forward_router_address: 2001:db8:2000:2::2
|
|
interface: FastEthernet0/0/0/11
|
|
description: PROD1
|
|
state: merged
|
|
register: base_config
|
|
|
|
- name: Gather interfaces facts
|
|
iosxr_facts:
|
|
gather_subset:
|
|
- "!all"
|
|
- "!min"
|
|
gather_network_resources:
|
|
- static_routes
|
|
|
|
- name: Apply the provided configuration (config to be reverted)
|
|
iosxr_static_routes:
|
|
config:
|
|
- vrf: TEST_SITE
|
|
address_families:
|
|
- afi: ipv4
|
|
safi: unicast
|
|
routes:
|
|
- dest: 192.0.2.80/28
|
|
next_hops:
|
|
- forward_router_address: 192.0.2.12
|
|
interface: FastEthernet0/0/0/3
|
|
description: "DEV_MOVED"
|
|
dest_vrf: dev_moved
|
|
state: overridden
|
|
register: result
|
|
|
|
- name: Assert that changes were applied
|
|
assert:
|
|
that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length == 0 }}"
|
|
|
|
- name: Revert back to base config using facts round trip
|
|
iosxr_static_routes:
|
|
config: "{{ ansible_facts['network_resources']['static_routes'] }}"
|
|
state: overridden
|
|
register: revert
|
|
|
|
- name: Assert that config was reverted
|
|
assert:
|
|
that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}"
|
|
|
|
always:
|
|
- include_tasks: _remove_config.yaml
|