Skip to content

Commit

Permalink
mysql_user: added flush privileges to write dynamic privs into db (an…
Browse files Browse the repository at this point in the history
…sible-collections#338)

* added flush privileges to write dynamic privs into db
Fixes ansible-collections#120

* added changelog fragment

* Update changelogs/fragments/338-mysql_user_fix_missing_dynamic_privileges.yml

Co-authored-by: Andrew Klychkov <[email protected]>

Co-authored-by: Andrew Klychkov <[email protected]>
  • Loading branch information
bigo8525 and Andersson007 authored Apr 29, 2022
1 parent 4aab8ac commit 1dcc5ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "mysql_user - fix missing dynamic privileges after revoke and grant privileges to user (https://github.com/ansible-collections/community.mysql/issues/120)."
1 change: 1 addition & 0 deletions plugins/module_utils/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ def privileges_revoke(cursor, user, host, db_table, priv, grant_option, maria_ro

query = ' '.join(query)
cursor.execute(query, params)
cursor.execute("FLUSH PRIVILEGES")


def privileges_grant(cursor, user, host, db_table, priv, tls_requires, maria_role=False):
Expand Down

0 comments on commit 1dcc5ec

Please sign in to comment.