fix nxos_static_route issues (#37614)

* fix nxos_static_route issues

* remove nxos_static_route from ignore
This commit is contained in:
saichint 2018-03-26 08:13:32 -07:00 committed by Trishna Guha
commit 0df5cfd41f
4 changed files with 60 additions and 57 deletions

View file

@ -1,2 +1,5 @@
---
testcase: "*"
vrfs:
- default
- myvrf

View file

@ -11,8 +11,9 @@
route_name: testing
pref: 100
tag: 5500
vrf: testing
vrf: "{{ item }}"
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
register: result
- assert: &true
@ -21,28 +22,51 @@
- 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
tag: 5500
vrf: testing
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
@ -96,9 +120,10 @@
route_name: testing
pref: 100
tag: 5500
vrf: testing
vrf: "{{ item }}"
state: absent
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
ignore_errors: yes
- name: remove static route aggregate

View file

@ -1287,7 +1287,6 @@ lib/ansible/modules/network/nxos/nxos_pim_interface.py E326
lib/ansible/modules/network/nxos/nxos_pim_rp_address.py E326
lib/ansible/modules/network/nxos/nxos_reboot.py E325
lib/ansible/modules/network/nxos/nxos_smu.py E324
lib/ansible/modules/network/nxos/nxos_static_route.py E324
lib/ansible/modules/network/nxos/nxos_system.py E325
lib/ansible/modules/network/nxos/nxos_vpc.py E324
lib/ansible/modules/network/nxos/nxos_vpc_interface.py E325