mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
parent
ba5e562c76
commit
dc61f4c6b1
2 changed files with 72 additions and 24 deletions
|
@ -3,21 +3,39 @@
|
|||
- debug: msg="Using provider={{ connection.transport }}"
|
||||
when: ansible_connection == "local"
|
||||
|
||||
- block:
|
||||
- name: 'Setup: Delete VRF before test'
|
||||
nxos_config:
|
||||
lines:
|
||||
- no vrf context ntc
|
||||
provider: "{{ connection }}"
|
||||
ignore_errors: yes
|
||||
- set_fact: intname1="{{ nxos_int1 }}"
|
||||
- set_fact: intname2="{{ nxos_int2 }}"
|
||||
|
||||
- set_fact: rdnd="1:2"
|
||||
when: (platform is not match("N35|N7K")) and ((imagetag != 'I2'))
|
||||
|
||||
- set_fact: rdd="default"
|
||||
when: (platform is not match("N35|N7K")) and ((imagetag != 'I2'))
|
||||
|
||||
- set_fact: vnind="5000"
|
||||
when: platform is not match("N35|N7K")
|
||||
|
||||
- set_fact: vnid="default"
|
||||
when: platform is not match("N35|N7K")
|
||||
|
||||
- name: "Enable feature BGP"
|
||||
nxos_feature:
|
||||
feature: bgp
|
||||
state: enabled
|
||||
provider: "{{ connection }}"
|
||||
ignore_errors: yes
|
||||
|
||||
- block:
|
||||
- name: Ensure ntc VRF exists on switch
|
||||
nxos_vrf: &configure
|
||||
vrf: ntc
|
||||
admin_state: down
|
||||
description: testing
|
||||
#vni: 5000
|
||||
#rd: auto
|
||||
vni: "{{vnind|default(omit)}}"
|
||||
rd: "{{rdnd|default(omit)}}"
|
||||
interfaces:
|
||||
- "{{ intname1 }}"
|
||||
- "{{ intname2 }}"
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
|
@ -33,13 +51,30 @@
|
|||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
- pause:
|
||||
seconds: 30
|
||||
|
||||
- name: Remove config
|
||||
nxos_vrf: &remconf
|
||||
vrf: ntc
|
||||
admin_state: up
|
||||
vni: "{{vnid|default(omit)}}"
|
||||
rd: "{{rdd|default(omit)}}"
|
||||
interfaces: default
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
- assert: *true
|
||||
|
||||
- name: "Conf Idempotence"
|
||||
nxos_vrf: *remconf
|
||||
register: result
|
||||
|
||||
- assert: *false
|
||||
|
||||
- name: Ensure ntc VRF does not exist on switch
|
||||
nxos_vrf: &remove
|
||||
vrf: ntc
|
||||
admin_state: down
|
||||
description: testing
|
||||
#vni: 5000
|
||||
#rd: auto
|
||||
state: absent
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
@ -55,11 +90,12 @@
|
|||
|
||||
- assert: *false
|
||||
|
||||
- name: 'Teardown: Delete VRF after test'
|
||||
nxos_config:
|
||||
lines:
|
||||
- no vrf context ntc
|
||||
always:
|
||||
- name: "Disable feature BGP"
|
||||
nxos_feature:
|
||||
feature: bgp
|
||||
state: disabled
|
||||
provider: "{{ connection }}"
|
||||
ignore_errors: yes
|
||||
|
||||
- debug: msg="END connection={{ ansible_connection }} nxos_vrf sanity test"
|
||||
- debug: msg="END connection={{ ansible_connection }} nxos_vrf sanity test"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue