mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
6f8d3ad70d
* fix bgp issues * add new tests cases * review comments
68 lines
1.4 KiB
YAML
68 lines
1.4 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_bgp parameter test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- name: "Disable feature BGP"
|
|
nxos_feature:
|
|
feature: bgp
|
|
state: disabled
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- name: "Enable feature BGP"
|
|
nxos_feature:
|
|
feature: bgp
|
|
state: enabled
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- block:
|
|
# these tasks will fail on n3k running A8
|
|
# due to no support
|
|
- name: "set isolate"
|
|
nxos_bgp: &set1
|
|
asn: 65535
|
|
isolate: false
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_bgp: *set1
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: "reset isolate"
|
|
nxos_bgp: &reset1
|
|
asn: 65535
|
|
isolate: true
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_bgp: *reset1
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
rescue:
|
|
- debug: msg="Tests can fail on A8 images"
|
|
|
|
always:
|
|
- name: "Disable feature bgp"
|
|
nxos_feature:
|
|
feature: bgp
|
|
state: disabled
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_bgp parameter test"
|