ansible/test/integration/targets/ios_static_routes/tests/cli/merged.yaml
Sumit Jaiswal 4c0eb4396b
Resource module for IOS static routes (#64632)
* ios_static_routes
2020-02-28 18:29:17 +05:30

66 lines
2 KiB
YAML

---
- debug:
msg: "START Merged ios_static_routes state for integration tests on connection={{ ansible_connection }}"
- include_tasks: _remove_config.yaml
- include_tasks: _intial_setup_config.yaml
- block:
- name: Merge provided configuration with device configuration
ios_static_routes: &merged
config:
- vrf: ansible_temp_vrf
address_families:
- afi: ipv4
routes:
- dest: 192.0.2.0/24
next_hops:
- forward_router_address: 192.0.2.1
name: merged_vrf
tag: 50
track: 150
- address_families:
- afi: ipv4
routes:
- dest: 198.51.100.0/24
next_hops:
- forward_router_address: 198.51.101.1
name: merged_route_1
distance_metric: 110
tag: 40
multicast: True
- forward_router_address: 198.51.101.2
name: merged_route_2
distance_metric: 30
- forward_router_address: 198.51.101.3
name: merged_route_3
- afi: ipv6
routes:
- dest: 2001:DB8:0:3::/64
next_hops:
- forward_router_address: 2001:DB8:0:3::2
name: merged_v6
tag: 105
state: merged
register: result
- assert:
that:
- "result.commands|length == 5"
- "result.changed == true"
- "result.commands|symmetric_difference(merged.commands) == []"
- name: Merge provided configuration with device configuration (IDEMPOTENT)
ios_static_routes: *merged
register: result
- name: Assert that the previous task was idempotent
assert:
that:
- "result.commands|length == 0"
- "result['changed'] == false"
always:
- include_tasks: _populate_config.yaml
- include_tasks: _remove_config.yaml