mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ce3d1c6ba0
* eos_user fix username param Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Add setup eos_user test and rename username for consistency Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * update unit test and pep8 fix Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * pep8 fix
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
---
|
|
- name: Set Up
|
|
eos_config:
|
|
lines:
|
|
- no username ansibletest1
|
|
- no username ansibletest2
|
|
- no username ansibletest3
|
|
provider: "{{ cli }}"
|
|
|
|
- name: Create user
|
|
eos_user:
|
|
name: ansibletest1
|
|
privilege: 15
|
|
role: network-operator
|
|
state: present
|
|
authorize: yes
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- 'result.commands == ["username ansibletest1 role network-operator", "username ansibletest1 privilege 15"]'
|
|
|
|
- name: Collection of users
|
|
eos_user:
|
|
aggregate:
|
|
- name: ansibletest2
|
|
- name: ansibletest3
|
|
authorize: yes
|
|
state: present
|
|
role: network-operator
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- 'result.commands == ["username ansibletest2 role network-operator", "username ansibletest3 role network-operator"]'
|
|
|
|
- name: tearDown
|
|
eos_config:
|
|
lines:
|
|
- no username ansibletest1
|
|
- no username ansibletest2
|
|
- no username ansibletest3
|
|
provider: "{{ cli }}"
|