mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Fix ios_user not able to handle certain scenario (#47656)
* added support for users with password(not secret) configs Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Added example Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Fix typo Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Fix pep8 Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Add integration tests Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
This commit is contained in:
parent
c53e3ca8e9
commit
baae7fa9ba
2 changed files with 57 additions and 1 deletions
|
@ -5,6 +5,8 @@
|
|||
- name: ansibletest1
|
||||
- name: ansibletest2
|
||||
- name: ansibletest3
|
||||
- name: ansibletest4
|
||||
- name: ansibletest5
|
||||
state: absent
|
||||
provider: "{{ cli }}"
|
||||
|
||||
|
@ -66,12 +68,40 @@
|
|||
- 'result.changed == false'
|
||||
- 'result.commands | length == 0'
|
||||
|
||||
- name: Create user with password_type (password)
|
||||
ios_user:
|
||||
name: ansibleuser4
|
||||
password_type: password
|
||||
configured_password: testpass
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- "'username ansibleuser4 password' in result.commands[0]"
|
||||
|
||||
- name: Create user with password_type (secret)
|
||||
ios_user:
|
||||
name: ansibleuser5
|
||||
password_type: secret
|
||||
configured_password: testpass
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- "'username ansibleuser5 secret' in result.commands[0]"
|
||||
|
||||
- name: tearDown
|
||||
ios_user:
|
||||
aggregate:
|
||||
- name: ansibletest1
|
||||
- name: ansibletest2
|
||||
- name: ansibletest3
|
||||
- name: ansibletest4
|
||||
- name: ansibletest5
|
||||
state: absent
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue