2017-06-08 08:58:29 +02:00
|
|
|
---
|
2017-08-16 08:38:59 +02:00
|
|
|
- name: Set Up
|
|
|
|
eos_config:
|
|
|
|
lines:
|
|
|
|
- no username ansibletest1
|
|
|
|
- no username ansibletest2
|
|
|
|
- no username ansibletest3
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
|
2017-06-08 08:58:29 +02:00
|
|
|
- name: Create user
|
|
|
|
eos_user:
|
2017-08-16 08:38:59 +02:00
|
|
|
name: ansibletest1
|
2017-06-08 08:58:29 +02:00
|
|
|
privilege: 15
|
|
|
|
role: network-operator
|
|
|
|
state: present
|
|
|
|
authorize: yes
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
2017-08-16 08:38:59 +02:00
|
|
|
- 'result.commands == ["username ansibletest1 role network-operator", "username ansibletest1 privilege 15"]'
|
2017-06-08 08:58:29 +02:00
|
|
|
|
|
|
|
- name: Collection of users
|
|
|
|
eos_user:
|
2017-07-26 16:09:17 +02:00
|
|
|
aggregate:
|
2017-08-16 08:38:59 +02:00
|
|
|
- name: ansibletest2
|
|
|
|
- name: ansibletest3
|
2017-06-08 08:58:29 +02:00
|
|
|
authorize: yes
|
|
|
|
state: present
|
2017-07-17 13:56:32 +02:00
|
|
|
role: network-operator
|
2017-06-08 08:58:29 +02:00
|
|
|
provider: "{{ cli }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
2017-08-16 08:38:59 +02:00
|
|
|
- 'result.commands == ["username ansibletest2 role network-operator", "username ansibletest3 role network-operator"]'
|
2017-06-08 08:58:29 +02:00
|
|
|
|
|
|
|
- name: tearDown
|
2017-07-17 14:28:03 +02:00
|
|
|
eos_config:
|
|
|
|
lines:
|
2017-08-16 08:38:59 +02:00
|
|
|
- no username ansibletest1
|
|
|
|
- no username ansibletest2
|
|
|
|
- no username ansibletest3
|
2017-06-08 08:58:29 +02:00
|
|
|
provider: "{{ cli }}"
|