mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Add ios_user implementation module (#25413)
* Add ios_user module Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Integration test for ios_user Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Add unit test for ios_user Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
eb349cb201
commit
91e5fce90f
9 changed files with 517 additions and 0 deletions
43
test/integration/targets/ios_user/tests/cli/basic.yaml
Normal file
43
test/integration/targets/ios_user/tests/cli/basic.yaml
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
- name: Create user
|
||||
ios_user:
|
||||
name: netend
|
||||
privilege: 15
|
||||
role: network-operator
|
||||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["username netend view network-operator", "username netend privilege 15"]'
|
||||
|
||||
- name: Collection of users
|
||||
ios_user:
|
||||
users:
|
||||
- name: test1
|
||||
- name: test2
|
||||
authorize: yes
|
||||
state: present
|
||||
view: network-admin
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["username test1 view network-admin", "username test2 view network-admin"]'
|
||||
|
||||
- name: tearDown
|
||||
ios_user:
|
||||
purge: yes
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["no username netend", "no username test1", "no username test2"]'
|
Loading…
Add table
Add a link
Reference in a new issue