2017-06-06 16:35:08 +02:00
|
|
|
---
|
2017-12-07 23:01:28 +01:00
|
|
|
- name: Setup
|
|
|
|
net_user: &clear_netop
|
|
|
|
name: netop
|
|
|
|
state: absent
|
|
|
|
authorize: yes
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
|
2017-06-06 16:35:08 +02:00
|
|
|
- name: Create user
|
|
|
|
net_user:
|
|
|
|
name: netop
|
2017-12-07 23:01:28 +01:00
|
|
|
nopassword: yes
|
2017-06-06 16:35:08 +02:00
|
|
|
state: present
|
2017-12-07 23:01:28 +01:00
|
|
|
authorize: yes
|
2017-06-06 16:35:08 +02:00
|
|
|
provider: "{{ cli }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
2017-12-07 23:01:28 +01:00
|
|
|
- 'result.commands == ["username netop nopassword"]'
|
2017-06-06 16:35:08 +02:00
|
|
|
|
2017-12-07 23:01:28 +01:00
|
|
|
- name: tearDown
|
|
|
|
net_user: *clear_netop
|
2017-06-06 16:35:08 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- 'result.commands == ["no username netop"]'
|