ansible/test/integration/targets/nxos_aaa_server/tests/common/tacacs.yaml
Trishna Guha 536dff507d
stable-2.5 nxos bugfix cherry-pick (#38372)
* nxos_vlan purge (#38202)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 119352b538)

* fix nxos_aaa_server issues (#38117)

(cherry picked from commit 697c301f04)

* fix nxos_aaa_server_host issues (#38188)

(cherry picked from commit 24cc6b80bd)

* fix nxos_static_route issues (#37614)

* fix nxos_static_route issues

* remove nxos_static_route from ignore

(cherry picked from commit 0df5cfd41f)

* fix nxos_acl issues (#38283)

* fix nxos_acl issues

* typo fix

* typo fix in sanity.yaml

* another typo fix in sanity.yaml

(cherry picked from commit 1bf29651af)

* nxos_acl_interface tests addition (#38230)

(cherry picked from commit b8cb382a40)

* update changelog with nxos bugfixes for 2.5

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* revert ignore.txt

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-04-06 02:30:32 -04:00

116 lines
2.7 KiB
YAML

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