mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.1 KiB
YAML
54 lines
1.1 KiB
YAML
8 years ago
|
---
|
||
7 years ago
|
- name: Remove old entries of user
|
||
|
nxos_user:
|
||
|
aggregate:
|
||
|
- name: ansibletest1
|
||
|
- name: ansibletest2
|
||
|
- name: ansibletest3
|
||
|
state: absent
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
|
||
|
# Start tests
|
||
8 years ago
|
- name: Create user
|
||
|
nxos_user:
|
||
7 years ago
|
name: ansibletest1
|
||
8 years ago
|
roles: network-operator
|
||
|
state: present
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
8 years ago
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- 'result.changed == true'
|
||
7 years ago
|
- '"username" in result.commands[0]'
|
||
|
- '"role network-operator" in result.commands[1]'
|
||
8 years ago
|
|
||
|
- name: Collection of users
|
||
|
nxos_user:
|
||
7 years ago
|
aggregate:
|
||
7 years ago
|
- name: ansibletest2
|
||
|
- name: ansibletest3
|
||
8 years ago
|
state: present
|
||
|
roles: network-admin
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
8 years ago
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- 'result.changed == true'
|
||
|
|
||
|
- name: tearDown
|
||
|
nxos_user:
|
||
7 years ago
|
aggregate:
|
||
|
- name: ansibletest1
|
||
|
- name: ansibletest2
|
||
|
- name: ansibletest3
|
||
|
state: absent
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
8 years ago
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- 'result.changed == true'
|
||
7 years ago
|
- '"no username" in result.commands[0]'
|