mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
2.2 KiB
YAML
107 lines
2.2 KiB
YAML
7 years ago
|
---
|
||
|
- 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:
|
||
|
# 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
|
||
|
|
||
|
- assert: *false
|
||
|
|
||
|
# this task will fail on n9k running I2 or I4
|
||
|
# due to no support
|
||
|
- name: "set suppress fib"
|
||
|
nxos_bgp: &set2
|
||
|
asn: 65535
|
||
|
suppress_fib_pending: false
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: "Check Idempotence"
|
||
|
nxos_bgp: *set2
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
|
|
||
|
- name: "reset suppress fib"
|
||
|
nxos_bgp: &reset2
|
||
|
asn: 65535
|
||
|
suppress_fib_pending: true
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: "Check Idempotence"
|
||
|
nxos_bgp: *reset2
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
|
|
||
|
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"
|