Add update_password always and update_password on_create tests to iosxr_user (#27230)
* Add idempotency test to delete aggregate of iosxr users * Add update_password always and on_create asserts to iosxr_user
This commit is contained in:
parent
4ad022b622
commit
66f90d1401
1 changed files with 34 additions and 2 deletions
|
@ -21,10 +21,26 @@
|
|||
- '"username" in result.commands[0]'
|
||||
- '"secret" in result.commands[0]'
|
||||
|
||||
- name: Add user again (Idempotent)
|
||||
- name: Create user with update_password always (not idempotent)
|
||||
iosxr_user:
|
||||
name: ansibletest1
|
||||
password: test
|
||||
update_password: always
|
||||
state: present
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- '"username" in result.commands[0]'
|
||||
- '"secret" in result.commands[0]'
|
||||
|
||||
- name: Create user again with update_password on_create (idempotent)
|
||||
iosxr_user:
|
||||
name: ansibletest1
|
||||
password: test
|
||||
update_password: on_create
|
||||
state: present
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
@ -49,7 +65,7 @@
|
|||
- 'result.changed == true'
|
||||
- 'result.commands == ["username ansibletest2 group sysadmin", "username ansibletest3 group sysadmin"]'
|
||||
|
||||
- name: Add collection of users again (Idempotent)
|
||||
- name: Add collection of users again with update_password always (not idempotent)
|
||||
iosxr_user:
|
||||
users:
|
||||
- name: ansibletest2
|
||||
|
@ -59,6 +75,22 @@
|
|||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["username ansibletest2 group sysadmin", "username ansibletest3 group sysadmin"]'
|
||||
|
||||
- name: Add collection of users again with update_password on_create (idempotent)
|
||||
iosxr_user:
|
||||
users:
|
||||
- name: ansibletest2
|
||||
- name: ansibletest3
|
||||
update_password: on_create
|
||||
state: present
|
||||
group: sysadmin
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == false'
|
||||
|
|
Loading…
Reference in a new issue