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

58 lines
1.8 KiB
YAML

---
- debug:
msg: "START Overridden ios_static_routes state for integration tests on connection={{ ansible_connection }}"
- include_tasks: _remove_config.yaml
- include_tasks: _intial_setup_config.yaml
- block:
- name: Override device configuration of all interfaces with provided configuration
ios_static_routes: &overridden
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: override_vrf
tag: 50
track: 150
- address_families:
- afi: ipv4
routes:
- dest: 198.51.100.0/24
next_hops:
- forward_router_address: 198.51.101.3
name: override_route
- afi: ipv6
routes:
- dest: 2001:DB8:0:3::/64
next_hops:
- forward_router_address: 2001:DB8:0:3::2
name: override_v6
tag: 175
state: overridden
register: result
- assert:
that:
- "result.commands|length == 8"
- "result.changed == true"
- "result.commands|symmetric_difference(overridden.commands) == []"
- name: Override device configuration of all interfaces with provided configuration (IDEMPOTENT)
ios_static_routes: *overridden
register: result
- name: Assert that task was idempotent
assert:
that:
- "result.commands|length == 0"
- "result['changed'] == false"
always:
- include_tasks: _populate_config.yaml
- include_tasks: _remove_config.yaml