mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
a5b483da16
username param is read by eos action plugion load_provider, if present it is set as the play context remote user. That means if you have a play remote_user: admin it won't be used, but instead whatever is put in the task argument username. Changing the tests to use name fixes the issue, we may want to remove username as valid module argument in other change.
39 lines
856 B
YAML
39 lines
856 B
YAML
---
|
|
- name: Create user
|
|
eos_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 role network-operator", "username netend privilege 15"]'
|
|
|
|
- name: Collection of users
|
|
eos_user:
|
|
aggregate:
|
|
- name: test1
|
|
- name: test2
|
|
authorize: yes
|
|
state: present
|
|
role: network-operator
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- 'result.commands == ["username test1 role network-operator", "username test2 role network-operator"]'
|
|
|
|
- name: tearDown
|
|
eos_config:
|
|
lines:
|
|
- no username netend
|
|
- no username test1
|
|
- no username test2
|
|
provider: "{{ cli }}"
|