079b7cb1fe
* nxos_linkagg normalize interface (#39591) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit3c35dd4f7f
) * use show run instead of section pipeline ios_l2_interface (#39658) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commitdddcbb7198
) * add changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix nxos_snmp_user issues (#39760) * fix nxos_snmp_user issues * shipppable fix (cherry picked from commite3bfbe5875
) * changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix shippable Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
90 lines
1.7 KiB
YAML
90 lines
1.7 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
|
|
provider: "{{ connection }}"
|
|
|
|
- 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
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: Add another group to user
|
|
nxos_snmp_user: &chg
|
|
user: ntc
|
|
group: network-admin
|
|
provider: "{{ connection }}"
|
|
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
|
|
provider: "{{ connection }}"
|
|
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
|
|
provider: "{{ connection }}"
|
|
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"
|