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
|
|
|
- debug: msg="This test is not supported on {{ image_version }}"
|
|
|
|
when: imagetag is search("D1")
|
|
|
|
- set_fact: test_helsinki="false"
|
|
|
|
- set_fact: test_helsinki="true"
|
|
|
|
when: imagetag is not search("D1")
|
|
|
|
|
2018-01-10 05:22:26 +00:00
|
|
|
- name: "Disable feature BGP"
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 05:22:26 +00:00
|
|
|
state: disabled
|
|
|
|
ignore_errors: yes
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- name: "Enable feature BGP"
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 05:22:26 +00:00
|
|
|
state: enabled
|
|
|
|
ignore_errors: yes
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- block:
|
|
|
|
# these tasks will fail on n7k running helsinki
|
|
|
|
# due to no support
|
|
|
|
- name: "set helsinki"
|
|
|
|
nxos_bgp: &set1
|
|
|
|
asn: 65535
|
|
|
|
vrf: "{{ item }}"
|
|
|
|
graceful_restart_timers_restart: 130
|
|
|
|
graceful_restart_timers_stalepath_time: 310
|
|
|
|
neighbor_down_fib_accelerate: true
|
|
|
|
reconnect_interval: 55
|
|
|
|
timer_bgp_hold: 110
|
|
|
|
timer_bgp_keepalive: 45
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 05:22:26 +00:00
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *set1
|
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- name: "reset helsinki"
|
|
|
|
nxos_bgp: &reset1
|
|
|
|
asn: 65535
|
|
|
|
vrf: "{{ item }}"
|
|
|
|
graceful_restart: true
|
|
|
|
graceful_restart_timers_restart: default
|
|
|
|
graceful_restart_timers_stalepath_time: default
|
|
|
|
neighbor_down_fib_accelerate: false
|
|
|
|
reconnect_interval: default
|
|
|
|
timer_bgp_hold: default
|
|
|
|
timer_bgp_keepalive: default
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 05:22:26 +00:00
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- assert: *true
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- name: "Check Idempotence"
|
|
|
|
nxos_bgp: *reset1
|
|
|
|
with_items: "{{ vrfs }}"
|
|
|
|
register: result
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- assert: *false
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
rescue:
|
|
|
|
- debug: msg="Tests can fail on helsinki images"
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: "Disable feature bgp"
|
|
|
|
nxos_feature:
|
|
|
|
feature: bgp
|
2018-07-02 13:43:51 +00:00
|
|
|
provider: "{{ connection }}"
|
2018-01-10 05:22:26 +00:00
|
|
|
state: disabled
|
|
|
|
ignore_errors: yes
|
2018-02-05 06:43:30 +00:00
|
|
|
when: test_helsinki
|
2018-01-10 05:22:26 +00:00
|
|
|
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_bgp parameter test"
|