483df13626
* I seem to have forgotten the back half of tests * Set http timeout from persistent_command_timeout * Tweak URL generation and provide URL on error * Push var_options to connection process * Don't wait forever if coming from persistent * Don't send the entire contents of variables to ansible-connection
85 lines
1.6 KiB
YAML
85 lines
1.6 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_snmp_user sanity test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- name: Remove snmp user
|
|
nxos_snmp_user: &remove
|
|
user: ntc
|
|
state: absent
|
|
|
|
- pause:
|
|
seconds: 5
|
|
|
|
- block:
|
|
- name: Create snmp user
|
|
nxos_snmp_user: &create
|
|
user: ntc
|
|
group: network-operator
|
|
authentication: md5
|
|
pwd: N$tOpe%1
|
|
privacy: HelloU$er1
|
|
encrypt: true
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: Add another group to user
|
|
nxos_snmp_user: &chg
|
|
user: ntc
|
|
group: network-admin
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_snmp_user: *chg
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: Remove group from user
|
|
nxos_snmp_user: &remg
|
|
user: ntc
|
|
group: network-admin
|
|
state: absent
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- pause:
|
|
seconds: 5
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_snmp_user: *remg
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: delete snmp user
|
|
nxos_snmp_user: &remove1
|
|
user: ntc
|
|
group: network-operator
|
|
state: absent
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- pause:
|
|
seconds: 5
|
|
|
|
- name: "Remove Idempotence"
|
|
nxos_snmp_user: *remove1
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
always:
|
|
- name: delete snmp user
|
|
nxos_snmp_user: *remove
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_snmp_user sanity test"
|