536dff507d
* nxos_vlan purge (#38202) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit119352b538
) * fix nxos_aaa_server issues (#38117) (cherry picked from commit697c301f04
) * fix nxos_aaa_server_host issues (#38188) (cherry picked from commit24cc6b80bd
) * fix nxos_static_route issues (#37614) * fix nxos_static_route issues * remove nxos_static_route from ignore (cherry picked from commit0df5cfd41f
) * fix nxos_acl issues (#38283) * fix nxos_acl issues * typo fix * typo fix in sanity.yaml * another typo fix in sanity.yaml (cherry picked from commit1bf29651af
) * nxos_acl_interface tests addition (#38230) (cherry picked from commitb8cb382a40
) * update changelog with nxos bugfixes for 2.5 Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * revert ignore.txt Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
138 lines
3.3 KiB
YAML
138 lines
3.3 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_static_route sanity test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- block:
|
|
- name: create static route
|
|
nxos_static_route: &configure
|
|
prefix: "192.168.20.64/24"
|
|
next_hop: "3.3.3.3"
|
|
route_name: testing
|
|
pref: 100
|
|
tag: 5500
|
|
vrf: "{{ item }}"
|
|
provider: "{{ connection }}"
|
|
with_items: "{{ vrfs }}"
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: "Conf Idempotence"
|
|
nxos_static_route: *configure
|
|
with_items: "{{ vrfs }}"
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: change static route
|
|
nxos_static_route: &configure1
|
|
prefix: "192.168.20.64/24"
|
|
next_hop: "3.3.3.3"
|
|
route_name: default
|
|
pref: 10
|
|
tag: default
|
|
vrf: "{{ item }}"
|
|
provider: "{{ connection }}"
|
|
with_items: "{{ vrfs }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Conf1 Idempotence"
|
|
nxos_static_route: *configure1
|
|
with_items: "{{ vrfs }}"
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: remove static route
|
|
nxos_static_route: &remove
|
|
prefix: "192.168.20.64/24"
|
|
next_hop: "3.3.3.3"
|
|
route_name: testing
|
|
pref: 100
|
|
vrf: "{{ item }}"
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
with_items: "{{ vrfs }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Remove Idempotence"
|
|
nxos_static_route: *remove
|
|
with_items: "{{ vrfs }}"
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: configure static route(aggregate)
|
|
nxos_static_route: &conf_agg
|
|
aggregate:
|
|
- { prefix: "192.168.22.64/24", next_hop: "3.3.3.3" }
|
|
- { prefix: "192.168.24.64/24", next_hop: "3.3.3.3" }
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: configure static route aggregate(Idempotence)
|
|
nxos_static_route: *conf_agg
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: remove static route aggregate
|
|
nxos_static_route: &remove_agg
|
|
aggregate:
|
|
- { prefix: "192.168.22.64/24", next_hop: "3.3.3.3" }
|
|
- { prefix: "192.168.24.64/24", next_hop: "3.3.3.3" }
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: remove static route aggregate(Idempotence)
|
|
nxos_static_route: *remove_agg
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
always:
|
|
- name: remove static route
|
|
nxos_static_route:
|
|
prefix: "192.168.20.64/24"
|
|
next_hop: "3.3.3.3"
|
|
route_name: testing
|
|
pref: 100
|
|
tag: 5500
|
|
vrf: "{{ item }}"
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
with_items: "{{ vrfs }}"
|
|
ignore_errors: yes
|
|
|
|
- name: remove static route aggregate
|
|
nxos_static_route:
|
|
aggregate:
|
|
- { prefix: "192.168.22.64/24", next_hop: "3.3.3.3" }
|
|
- { prefix: "192.168.24.64/24", next_hop: "3.3.3.3" }
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_static_route sanity test"
|