2018-01-10 06:22:26 +01:00
|
|
|
---
|
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_bgp parameter test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
|
|
|
|
2018-02-05 07:43:30 +01:00
|
|
|
|
|
|
|
- debug: msg="This bgp_isolate is not supported on {{ image_version }}"
|
|
|
|
when: imagetag is search("A8")
|
|
|
|
- set_fact: bgp_isolate="false"
|
|
|
|
- set_fact: bgp_isolate="true"
|
|
|
|
when: imagetag is not search("A8")
|
|
|
|
|
2018-01-10 06:22:26 +01:00
|
|
|
- name: "Disable feature BGP"
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 06:22:26 +01:00
|
|
|
state: disabled
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: "Enable feature BGP"
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 06:22:26 +01:00
|
|
|
state: enabled
|
|
|
|
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
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 06:22:26 +01:00
|
|
|
register: result
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_isolate
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_isolate
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *set1
|
|
|
|
register: result
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_isolate
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_isolate
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- name: "reset isolate"
|
|
|
|
nxos_bgp: &reset1
|
|
|
|
asn: 65535
|
|
|
|
isolate: true
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 06:22:26 +01:00
|
|
|
register: result
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_isolate
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- assert: *true
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_isolate
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *reset1
|
|
|
|
register: result
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_isolate
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- assert: *false
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_isolate
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
rescue:
|
|
|
|
- debug: msg="Tests can fail on A8 images"
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: "Disable feature bgp"
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
2018-07-02 15:43:51 +02:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 06:22:26 +01:00
|
|
|
state: disabled
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_bgp parameter test"
|