2018-01-10 05:22:26 +00:00
|
|
|
---
|
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_bgp parameter test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
|
|
|
|
2018-02-05 06:43:30 +00:00
|
|
|
- set_fact: bgp_best_path_limit="false"
|
|
|
|
- set_fact: bgp_best_path_limit="true"
|
|
|
|
when: imagetag is not search("I2")
|
|
|
|
|
|
|
|
- set_fact: bgp_suppress_fib_supported="false"
|
|
|
|
- set_fact: bgp_suppress_fib_supported="true"
|
|
|
|
when: imagetag is not search("A8|D1|I2|I4")
|
|
|
|
|
2018-01-10 05:22:26 +00:00
|
|
|
- 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:
|
|
|
|
# this task will fail on n9k running I2
|
|
|
|
# due to no support
|
|
|
|
- name: "set bestpath limit"
|
|
|
|
nxos_bgp: &set1
|
|
|
|
asn: 65535
|
|
|
|
vrf: "{{ item }}"
|
|
|
|
timer_bestpath_limit: 255
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *set1
|
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: "reset bestpath limit"
|
|
|
|
nxos_bgp: &reset1
|
|
|
|
asn: 65535
|
|
|
|
vrf: "{{ item }}"
|
|
|
|
timer_bestpath_limit: default
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *reset1
|
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
2018-02-05 06:43:30 +00:00
|
|
|
when: bgp_best_path_limit
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- assert: *false
|
2018-02-05 06:43:30 +00:00
|
|
|
when: bgp_best_path_limit
|
2018-01-10 05:22:26 +00:00
|
|
|
|
2018-02-05 06:43:30 +00:00
|
|
|
# Property does not nvgen on some images
|
|
|
|
# still try and set it but don't check idempotence
|
2018-01-10 05:22:26 +00:00
|
|
|
- name: "set suppress fib"
|
|
|
|
nxos_bgp: &set2
|
|
|
|
asn: 65535
|
|
|
|
suppress_fib_pending: false
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
2018-02-05 06:43:30 +00:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *set2
|
|
|
|
register: result
|
2018-02-05 06:43:30 +00:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- assert: *false
|
2018-02-05 06:43:30 +00:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- name: "reset suppress fib"
|
|
|
|
nxos_bgp: &reset2
|
|
|
|
asn: 65535
|
|
|
|
suppress_fib_pending: true
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
2018-02-05 06:43:30 +00:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *reset2
|
|
|
|
register: result
|
2018-02-05 06:43:30 +00:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- assert: *false
|
2018-02-05 06:43:30 +00:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
rescue:
|
|
|
|
- debug: msg="Tests can fail on I2/I4/A8/Fretta or helsinki 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"
|