HTTP(S) API connection plugin (#39224)

* 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
This commit is contained in:
Nathaniel Case 2018-05-17 18:47:15 -04:00 committed by GitHub
commit e9d7fa0418
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
277 changed files with 1325 additions and 1676 deletions

View file

@ -1,5 +1,5 @@
---
- name: collect common nxapi test cases
- name: collect common test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
@ -20,8 +20,8 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test cases (connection=local)
include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
- name: run test cases (connection=httpapi)
include: "{{ test_case_to_run }} ansible_connection=httpapi"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run

View file

@ -13,14 +13,12 @@
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:
@ -30,7 +28,6 @@
disable_policy_batching: true
disable_policy_batching_ipv4_prefix_list: v4_p
disable_policy_batching_ipv6_prefix_list: v6_p
provider: "{{ connection }}"
register: result
when: bgp_disable_policy
@ -55,7 +52,6 @@
disable_policy_batching: false
disable_policy_batching_ipv4_prefix_list: default
disable_policy_batching_ipv6_prefix_list: default
provider: "{{ connection }}"
register: result
when: bgp_disable_policy
@ -78,7 +74,6 @@
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_bgp parameter test"

View file

@ -13,7 +13,6 @@
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
ignore_errors: yes
when: test_helsinki
@ -21,7 +20,6 @@
nxos_feature:
feature: bgp
state: enabled
provider: "{{ connection }}"
ignore_errors: yes
when: test_helsinki
@ -38,7 +36,6 @@
reconnect_interval: 55
timer_bgp_hold: 110
timer_bgp_keepalive: 45
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
register: result
when: test_helsinki
@ -70,7 +67,6 @@
reconnect_interval: default
timer_bgp_hold: default
timer_bgp_keepalive: default
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
register: result
when: test_helsinki
@ -95,7 +91,6 @@
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
ignore_errors: yes
when: test_helsinki

View file

@ -14,14 +14,12 @@
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:
@ -31,7 +29,6 @@
nxos_bgp: &set1
asn: 65535
isolate: false
provider: "{{ connection }}"
register: result
when: bgp_isolate
@ -54,7 +51,6 @@
nxos_bgp: &reset1
asn: 65535
isolate: true
provider: "{{ connection }}"
register: result
when: bgp_isolate
@ -77,7 +73,6 @@
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_bgp parameter test"

View file

@ -7,14 +7,12 @@
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:
@ -35,7 +33,6 @@
graceful_restart_helper: true
log_neighbor_changes: true
maxas_limit: 50
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
register: result
@ -67,7 +64,6 @@
log_neighbor_changes: false
maxas_limit: default
router_id: default
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
register: result
@ -85,7 +81,6 @@
asn: 65535
vrf: "{{ item }}"
cluster_id: 10.0.0.1
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
register: result
@ -103,7 +98,6 @@
asn: 65535
vrf: "{{ item }}"
cluster_id: default
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
register: result
@ -124,7 +118,6 @@
- 16
- 22
- 18
provider: "{{ connection }}"
register: result
- assert: *true
@ -140,7 +133,6 @@
asn: 65535
confederation_id: default
confederation_peers: default
provider: "{{ connection }}"
register: result
- assert: *true
@ -161,7 +153,6 @@
- 16
- 22
- 18
provider: "{{ connection }}"
register: result
- assert: *true
@ -179,7 +170,6 @@
local_as: default
confederation_id: default
confederation_peers: default
provider: "{{ connection }}"
register: result
- assert: *true
@ -196,7 +186,6 @@
vrf: myvrf
local_as: 33
confederation_id: 99
provider: "{{ connection }}"
register: result
- assert: *true
@ -213,7 +202,6 @@
vrf: myvrf
confederation_id: default
local_as: default
provider: "{{ connection }}"
register: result
- assert: *true
@ -235,7 +223,6 @@
fast_external_fallover: false
flush_routes: true
shutdown: true
provider: "{{ connection }}"
register: result
- assert: *true
@ -254,7 +241,6 @@
fast_external_fallover: true
flush_routes: false
shutdown: false
provider: "{{ connection }}"
register: result
- assert: *true
@ -270,7 +256,6 @@
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_bgp parameter test"

View file

@ -16,14 +16,12 @@
nxos_feature:
feature: bgp
state: enabled
provider: "{{ connection }}"
ignore_errors: yes
- name: "Setup"
nxos_bgp: &remove
asn: 65535
state: absent
provider: "{{ connection }}"
ignore_errors: yes
register: result
@ -33,7 +31,6 @@
asn: 65535
router_id: 1.1.1.1
state: present
provider: "{{ connection }}"
register: result
- assert: &true
@ -95,7 +92,6 @@
event_history_periodic: size_small
suppress_fib_pending: true
state: present
provider: "{{ connection }}"
register: result
- assert: *true
@ -122,7 +118,6 @@
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
rescue:
- name: "Cleanup BGP"
@ -133,7 +128,6 @@
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
ignore_errors: yes
always:

View file

@ -15,14 +15,12 @@
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:
@ -33,7 +31,6 @@
asn: 65535
vrf: "{{ item }}"
timer_bestpath_limit: 255
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
register: result
@ -55,7 +52,6 @@
asn: 65535
vrf: "{{ item }}"
timer_bestpath_limit: default
provider: "{{ connection }}"
with_items: "{{ vrfs }}"
register: result
@ -76,7 +72,6 @@
nxos_bgp: &set2
asn: 65535
suppress_fib_pending: false
provider: "{{ connection }}"
register: result
- assert: *true
@ -94,7 +89,6 @@
nxos_bgp: &reset2
asn: 65535
suppress_fib_pending: true
provider: "{{ connection }}"
register: result
- assert: *true
@ -116,7 +110,6 @@
nxos_feature:
feature: bgp
state: disabled
provider: "{{ connection }}"
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_bgp parameter test"