ansible/test/integration/targets/vyos_user/tests/cli/basic.yaml
David Newswanger b818e986b6 Change network *_user modules to use configured_password to set a users password (#28187)
* WIP, update eos_user args

* refactor password for ios_user

* add eos tests, fix ios tests

* fixed password check

* refactor iosxr_user password

* fixed password arg for nxos

* [WIP] fix vyos_user password

* fix vyos tests

* update docs for net_user

* fix typo

* fix eos tests

* add warning when attempting to use password arg

* fix sanity/unit tests

* fix eos unit tests

* fix vyos_user aggregate

* fix typo in eos documentation string

* re add configured_password to vyos tests after rebase
2017-08-17 19:06:44 +05:30

81 lines
1.9 KiB
YAML

---
- name: Setup
vyos_config:
lines:
- delete system login user ansibletest1
- delete system login user ansibletest2
- delete system login user ansibletest3
provider: "{{ cli }}"
- name: Create user
vyos_user:
name: ansibletest1
configured_password: test
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"set system login user" in result.commands[0]'
- '"authentication plaintext-password" in result.commands[0]'
- name: Collection of users (SetUp)
vyos_user:
aggregate:
- name: ansibletest2
- name: ansibletest3
level: operator
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- 'result.commands == ["set system login user ansibletest2 level operator", "set system login user ansibletest3 level operator"]'
- name: Add user again (Idempotent)
vyos_user:
name: ansibletest1
configured_password: test
state: present
update_password: on_create
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == false'
- 'result.commands | length == 0'
- name: Add collection of users (Idempotent)
vyos_user:
aggregate:
- name: ansibletest2
- name: ansibletest3
level: operator
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == false'
- 'result.commands | length == 0'
- name: tearDown
vyos_user:
users:
- name: ansibletest1
- name: ansibletest2
- name: ansibletest3
state: absent
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- 'result.commands == ["delete system login user ansibletest1", "delete system login user ansibletest2", "delete system login user ansibletest3"]'