2018-01-10 06:22:26 +01:00
|
|
|
---
|
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_bgp parameter test"
|
|
|
|
|
2018-02-05 07:43:30 +01: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 06:22:26 +01:00
|
|
|
- name: "Disable feature BGP"
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
|
|
|
state: disabled
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: "Enable feature BGP"
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
|
|
|
state: enabled
|
|
|
|
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
|
|
|
|
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
|
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *reset1
|
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_best_path_limit
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- assert: *false
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_best_path_limit
|
2018-01-10 06:22:26 +01:00
|
|
|
|
2018-02-05 07:43:30 +01:00
|
|
|
# Property does not nvgen on some images
|
|
|
|
# still try and set it but don't check idempotence
|
2018-01-10 06:22:26 +01:00
|
|
|
- name: "set suppress fib"
|
|
|
|
nxos_bgp: &set2
|
|
|
|
asn: 65535
|
|
|
|
suppress_fib_pending: false
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *set2
|
|
|
|
register: result
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- assert: *false
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- name: "reset suppress fib"
|
|
|
|
nxos_bgp: &reset2
|
|
|
|
asn: 65535
|
|
|
|
suppress_fib_pending: true
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *reset2
|
|
|
|
register: result
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 06:22:26 +01:00
|
|
|
|
|
|
|
- assert: *false
|
2018-02-05 07:43:30 +01:00
|
|
|
when: bgp_suppress_fib_supported
|
2018-01-10 06:22:26 +01: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
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_bgp parameter test"
|