ansible/test/integration/targets/eos_user/tests/cli/basic.yaml
Ricardo Carrillo Cruz a5b483da16 Replace username for name in eos_user integration tests (#28067)
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.
2017-08-11 16:42:43 +02:00

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 }}"