diff --git a/changelogs/fragments/338-mysql_user_fix_missing_dynamic_privileges.yml b/changelogs/fragments/338-mysql_user_fix_missing_dynamic_privileges.yml new file mode 100644 index 0000000..1054ea6 --- /dev/null +++ b/changelogs/fragments/338-mysql_user_fix_missing_dynamic_privileges.yml @@ -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)." \ No newline at end of file diff --git a/plugins/module_utils/user.py b/plugins/module_utils/user.py index 8fe0629..dc82a60 100644 --- a/plugins/module_utils/user.py +++ b/plugins/module_utils/user.py @@ -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):