1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/nxos_aaa_server/tests/common/radius.yaml
Nathaniel Case e9d7fa0418
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
2018-05-17 18:47:15 -04:00

98 lines
2.3 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_aaa_server radius.yaml sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Setup"
nxos_aaa_server: &remove
server_type: radius
deadtime: default
server_timeout: default
directed_request: default
state: default
ignore_errors: yes
- block:
- name: "Configure radius server defaults"
nxos_aaa_server: &configure_default_radius
server_type: radius
state: present
register: result
- name: "Check Idempotence"
nxos_aaa_server: *configure_default_radius
register: result
- assert: &false
that:
- "result.changed == false"
- name: "Configure radius server non defaults"
nxos_aaa_server: &configure_radius_non_default
server_type: radius
server_timeout: 9
deadtime: 20
directed_request: enabled
state: present
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Check Idempotence"
nxos_aaa_server: *configure_radius_non_default
register: result
- assert: *false
- name: "Remove radius server configuration"
nxos_aaa_server: *remove
register: result
- assert: *true
- name: "Configure radius server with global key"
nxos_aaa_server: &configure_radius_global_key
server_type: radius
encrypt_type: 7
global_key: test_key
state: present
register: result
- assert: *true
- name: "Check Idempotence"
nxos_aaa_server: *configure_radius_global_key
register: result
- assert: *false
- name: "Remove radius server configuration"
nxos_aaa_server: &rad_def
server_type: radius
deadtime: default
server_timeout: default
global_key: default
directed_request: default
state: default
register: result
- assert: *true
- name: "Check Idempotence"
nxos_aaa_server: *rad_def
register: result
- assert: *false
rescue:
- debug: msg="connection={{ ansible_connection }} nxos_aaa_server failure detected"
always:
- name: "Remove radius server configuration"
nxos_aaa_server: *remove
register: result
- debug: msg="END connection={{ ansible_connection }} nxos_aaa_server radius.yaml sanity test"