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
66 lines
1.4 KiB
YAML
66 lines
1.4 KiB
YAML
---
|
|
- debug: msg="START nxapi/sanity.yaml on connection={{ ansible_connection }}"
|
|
|
|
- name: "Disable feature BGP"
|
|
nxos_feature:
|
|
feature: bgp
|
|
state: disabled
|
|
|
|
- block:
|
|
- name: "Run show running-config bgp - should fail"
|
|
nxos_command:
|
|
commands:
|
|
- sh running-config bgp
|
|
ignore_errors: yes
|
|
register: result
|
|
|
|
- assert: &fail
|
|
that:
|
|
- "result.failed == true"
|
|
|
|
- name: "Enable feature BGP"
|
|
nxos_feature:
|
|
feature: bgp
|
|
state: enabled
|
|
|
|
- name: "Configure BGP defaults"
|
|
nxos_bgp: &configure_default
|
|
asn: 65535
|
|
router_id: 1.1.1.1
|
|
state: present
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: "Run show running-config bgp - should pass"
|
|
nxos_command:
|
|
commands:
|
|
- sh running-config bgp
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.failed == false"
|
|
- "'65535' in result.stdout[0]|to_json"
|
|
|
|
- name: "Run an invalid command - should fail"
|
|
nxos_command:
|
|
commands:
|
|
- show interface bief
|
|
ignore_errors: yes
|
|
register: result
|
|
|
|
- assert: *fail
|
|
|
|
rescue:
|
|
- debug: msg="nxos_command sanity test failure detected"
|
|
|
|
always:
|
|
- name: "Disable feature bgp"
|
|
nxos_feature:
|
|
feature: bgp
|
|
state: disabled
|
|
|
|
- debug: msg="END nxapi/sanity.yaml on connection={{ ansible_connection }}"
|