mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
c371ed8d30
* Fix over-byte * Fix nxos_l2_interface docs * Update connections for tasks * Add default ssh port * Only report provider when using connection=local * Send empty provider when connection=network_cli * Fix find tasks
76 lines
1.6 KiB
YAML
76 lines
1.6 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_evpn_vni sanity test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- name: "Setup"
|
|
nxos_config: &remove_evpn
|
|
lines: no nv overlay evpn
|
|
provider: "{{ connection }}"
|
|
match: none
|
|
ignore_errors: yes
|
|
|
|
- block:
|
|
- name: "Enable feature BGP"
|
|
nxos_feature:
|
|
feature: bgp
|
|
state: enabled
|
|
provider: "{{ connection }}"
|
|
|
|
- name: "Enable nv overlay evpn"
|
|
nxos_config:
|
|
lines: nv overlay evpn
|
|
provider: "{{ connection }}"
|
|
match: none
|
|
|
|
- name: "Configure nxos_evpn_vni"
|
|
nxos_evpn_vni: &evpn_vni
|
|
vni: 6000
|
|
route_distinguisher: "60:10"
|
|
route_target_import:
|
|
- "5000:10"
|
|
- "4100:100"
|
|
route_target_export: auto
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_evpn_vni: *evpn_vni
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: "remove nxos_evpn_vni"
|
|
nxos_evpn_vni: &rvni
|
|
vni: 6000
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_evpn_vni: *rvni
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
always:
|
|
- name: "Remove nv overlay evpn"
|
|
nxos_config: *remove_evpn
|
|
ignore_errors: yes
|
|
|
|
- name: "Disable feature bgp"
|
|
nxos_feature:
|
|
feature: bgp
|
|
state: disabled
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_evpn_vni sanity test"
|