mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-22 21:00:23 -07:00
mysql_user: fix error when modifying user with host_all (#40)
* mysql_user: fix error when modifying user with host_all * Add changelog fragment and CI tests * Update changelogs/fragments/40-mysql_user_fix_error_when_host_all_used.yml Co-authored-by: Jorge Rodriguez (A.K.A. Tiriel) <jorge.rodriguez@tiriel.eu> Co-authored-by: Jorge Rodriguez (A.K.A. Tiriel) <jorge.rodriguez@tiriel.eu>
This commit is contained in:
parent
998913e5d2
commit
6322a65dbb
3 changed files with 4 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- mysql_user - fix module's crash when modifying a user with ``host_all`` (https://github.com/ansible-collections/community.mysql/issues/39).
|
|
@ -527,7 +527,7 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
|
||||||
old_user_mgmt = use_old_user_mgmt(cursor)
|
old_user_mgmt = use_old_user_mgmt(cursor)
|
||||||
|
|
||||||
if host_all:
|
if host_all:
|
||||||
hostnames = user_get_hostnames(cursor, [user])
|
hostnames = user_get_hostnames(cursor, user)
|
||||||
else:
|
else:
|
||||||
hostnames = [host]
|
hostnames = [host]
|
||||||
|
|
||||||
|
|
|
@ -196,6 +196,7 @@
|
||||||
name: '{{ user_name_1 }}'
|
name: '{{ user_name_1 }}'
|
||||||
priv: '%db.*:INSERT'
|
priv: '%db.*:INSERT'
|
||||||
append_privs: yes
|
append_privs: yes
|
||||||
|
host_all: yes
|
||||||
password: '{{ user_password_1 }}'
|
password: '{{ user_password_1 }}'
|
||||||
|
|
||||||
- name: show grants access for user1 on multiple database
|
- name: show grants access for user1 on multiple database
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue