ansible/test/integration/targets/eos_user/tests/cli/basic.yaml
Ricardo Carrillo Cruz bd24c4ce9d Use eos_config for eos_user tests teardown (#26893)
Purge is not idempotent, so let's fix it with other change.
For teardown, it's better to use eos_config/eos_command.
2017-07-17 14:28:03 +02:00

39 lines
864 B
YAML

---
- name: Create user
eos_user:
username: 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:
users:
- username: test1
- username: 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 }}"