mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
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
This commit is contained in:
parent
b1d297d144
commit
b818e986b6
18 changed files with 329 additions and 70 deletions
35
test/integration/targets/iosxr_user/tests/cli/auth.yaml
Normal file
35
test/integration/targets/iosxr_user/tests/cli/auth.yaml
Normal file
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
- block:
|
||||
- name: Create user with password
|
||||
iosxr_user:
|
||||
name: auth_user
|
||||
state: present
|
||||
provider: "{{ cli }}"
|
||||
configured_password: pass123
|
||||
|
||||
- name: test login
|
||||
expect:
|
||||
command: "ssh auth_user@{{ inventory_hostname }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no show version"
|
||||
responses:
|
||||
(?i)password: "pass123"
|
||||
|
||||
- name: test login with invalid password (should fail)
|
||||
expect:
|
||||
command: "ssh auth_user@{{ inventory_hostname }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no show version"
|
||||
responses:
|
||||
(?i)password: "badpass"
|
||||
ignore_errors: yes
|
||||
register: results
|
||||
|
||||
- name: check that attempt failed
|
||||
assert:
|
||||
that:
|
||||
- results.failed
|
||||
|
||||
always:
|
||||
- name: delete user
|
||||
iosxr_user:
|
||||
name: auth_user
|
||||
state: absent
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
|
@ -10,7 +10,7 @@
|
|||
- name: Create user (SetUp)
|
||||
iosxr_user:
|
||||
name: ansibletest1
|
||||
password: test
|
||||
configured_password: test
|
||||
state: present
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
@ -24,7 +24,7 @@
|
|||
- name: Create user with update_password always (not idempotent)
|
||||
iosxr_user:
|
||||
name: ansibletest1
|
||||
password: test
|
||||
configured_password: test
|
||||
update_password: always
|
||||
state: present
|
||||
provider: "{{ cli }}"
|
||||
|
@ -39,7 +39,7 @@
|
|||
- name: Create user again with update_password on_create (idempotent)
|
||||
iosxr_user:
|
||||
name: ansibletest1
|
||||
password: test
|
||||
configured_password: test
|
||||
update_password: on_create
|
||||
state: present
|
||||
provider: "{{ cli }}"
|
||||
|
@ -53,7 +53,7 @@
|
|||
- name: Modify user group
|
||||
iosxr_user:
|
||||
name: ansibletest1
|
||||
password: test
|
||||
configured_password: test
|
||||
update_password: on_create
|
||||
group: sysadmin
|
||||
state: present
|
||||
|
@ -69,7 +69,7 @@
|
|||
- name: Modify user group again (idempotent)
|
||||
iosxr_user:
|
||||
name: ansibletest1
|
||||
password: test
|
||||
configured_password: test
|
||||
update_password: on_create
|
||||
group: sysadmin
|
||||
state: present
|
||||
|
@ -86,7 +86,7 @@
|
|||
aggregate:
|
||||
- name: ansibletest2
|
||||
- name: ansibletest3
|
||||
password: test
|
||||
configured_password: test
|
||||
state: present
|
||||
group: sysadmin
|
||||
provider: "{{ cli }}"
|
||||
|
@ -107,7 +107,7 @@
|
|||
aggregate:
|
||||
- name: ansibletest2
|
||||
- name: ansibletest3
|
||||
password: test
|
||||
configured_password: test
|
||||
state: present
|
||||
group: sysadmin
|
||||
provider: "{{ cli }}"
|
||||
|
@ -126,7 +126,7 @@
|
|||
aggregate:
|
||||
- name: ansibletest2
|
||||
- name: ansibletest3
|
||||
password: test
|
||||
configured_password: test
|
||||
update_password: on_create
|
||||
state: present
|
||||
group: sysadmin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue