mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
e9d7fa0418
* HTTPAPI connection * Punt run_commands to cliconf or httpapi * Fake enable_mode on eapi * Pull changes to nxos * Move load_config to edit_config for future-preparedness * Don't fail on lldp disabled * Re-enable check_rc on nxos' run_commands * Reorganize nxos httpapi plugin for compatibility * draft docs for connection: httpapi * restores docs for connection:local for eapi * Add _remote_is_local to httpapi
115 lines
2.5 KiB
YAML
115 lines
2.5 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_bgp parameter test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- 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")
|
|
|
|
- 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
|
|
when: bgp_best_path_limit
|
|
|
|
- assert: *false
|
|
when: bgp_best_path_limit
|
|
|
|
# Property does not nvgen on some images
|
|
# still try and set it but don't check idempotence
|
|
- name: "set suppress fib"
|
|
nxos_bgp: &set2
|
|
asn: 65535
|
|
suppress_fib_pending: false
|
|
register: result
|
|
|
|
- assert: *true
|
|
when: bgp_suppress_fib_supported
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_bgp: *set2
|
|
register: result
|
|
when: bgp_suppress_fib_supported
|
|
|
|
- assert: *false
|
|
when: bgp_suppress_fib_supported
|
|
|
|
- name: "reset suppress fib"
|
|
nxos_bgp: &reset2
|
|
asn: 65535
|
|
suppress_fib_pending: true
|
|
register: result
|
|
|
|
- assert: *true
|
|
when: bgp_suppress_fib_supported
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_bgp: *reset2
|
|
register: result
|
|
when: bgp_suppress_fib_supported
|
|
|
|
- assert: *false
|
|
when: bgp_suppress_fib_supported
|
|
|
|
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"
|