2017-10-26 17:27:55 +02:00
|
|
|
---
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_snmp_user sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-10-26 17:27:55 +02:00
|
|
|
|
|
|
|
- name: Create snmp user
|
|
|
|
nxos_snmp_user: &create
|
|
|
|
user: ntc
|
|
|
|
group: network-operator
|
|
|
|
authentication: md5
|
|
|
|
pwd: N$tOpe%1
|
|
|
|
privacy: HelloU$er1
|
|
|
|
encrypt: true
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: delete snmp user
|
|
|
|
nxos_snmp_user: &remove
|
|
|
|
user: ntc
|
|
|
|
group: network-operator
|
|
|
|
authentication: md5
|
|
|
|
pwd: Testing1%
|
|
|
|
privacy: HelloU$er1
|
|
|
|
encrypt: true
|
|
|
|
state: absent
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: "Remove Idempotence"
|
|
|
|
nxos_snmp_user: *remove
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_snmp_user sanity test"
|