mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-08 11:40:33 -07:00
Add test for case where existing user have different password
This commit is contained in:
parent
5477db9037
commit
fa3c7b0c05
1 changed files with 22 additions and 0 deletions
|
@ -127,3 +127,25 @@
|
||||||
update_password: on_create
|
update_password: on_create
|
||||||
- username: test3
|
- username: test3
|
||||||
update_password: on_new_username
|
update_password: on_new_username
|
||||||
|
|
||||||
|
# another new user, another new password and multiple existing users with
|
||||||
|
# varying passwords without providing a password
|
||||||
|
- name: update_password | Create account with on_new_username while omit password
|
||||||
|
community.mysql.mysql_user:
|
||||||
|
login_user: '{{ mysql_parameters.login_user }}'
|
||||||
|
login_password: '{{ mysql_parameters.login_password }}'
|
||||||
|
login_host: '{{ mysql_parameters.login_host }}'
|
||||||
|
login_port: '{{ mysql_parameters.login_port }}'
|
||||||
|
state: present
|
||||||
|
name: test3
|
||||||
|
host: '10.10.10.10'
|
||||||
|
update_password: on_new_username
|
||||||
|
|
||||||
|
- name: update_password | Assert create account with on_new_username while omit password produce empty auth string
|
||||||
|
ansible.builtin.command: >-
|
||||||
|
{{ mysql_command }} -BNe "SELECT user, host, plugin, authentication_string
|
||||||
|
FROM mysql.user where user='test3' and host='10.10.10.10'"
|
||||||
|
register: test3_info
|
||||||
|
changed_when: false
|
||||||
|
failed_when:
|
||||||
|
- "'test3\t10.10.10.10\tmysql_native_password\t' != test3_info.stdout"
|
||||||
|
|
Loading…
Add table
Reference in a new issue