mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-02 14:40:21 -07:00
Fix privilege changing everytime (#438)
* Compare privileges from before and after manipulation * Add unit tests * Fix FIXME integration tests related to this issue * Fix sanity check * Fix assertion when appending privs in mysql_role_initial integration tests * Fix pylint * [ci-skip] Add changelog fragment * Fix: missing fragment file extension * Replace privileges_equal() by a comparison * Fix: sanity pylint * Fix: forgot to remove privileges_equal import from unit tests
This commit is contained in:
parent
ea73d408c3
commit
2d75bc19b8
4 changed files with 13 additions and 13 deletions
|
@ -1491,16 +1491,10 @@
|
|||
priv: '{{ test_db1 }}.{{ test_table }}:SELECT,INSERT/{{ test_db2 }}.{{ test_table }}:DELETE'
|
||||
append_privs: yes
|
||||
|
||||
# TODO it must be changed. The module uses user_mod function
|
||||
# taken from mysql_user module. It's a bug / expected behavior
|
||||
# because I added a similar tasks to mysql_user tests
|
||||
# https://github.com/ansible-collections/community.mysql/issues/50#issuecomment-871216825
|
||||
# and it's also failed. Create an issue after the module is merged to avoid conflicts.
|
||||
# TODO Fix this after user_mod is fixed.
|
||||
- name: Check
|
||||
- name: Check that there's no change
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is not changed
|
||||
|
||||
- name: Rewrite privs
|
||||
<<: *task_params
|
||||
|
|
|
@ -179,8 +179,6 @@
|
|||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
when: (install_type == 'mysql' and mysql_version is version('8', '<')) or
|
||||
(install_type == 'mariadb' and mariadb_version is version('10.5', '<'))
|
||||
|
||||
- name: remove username
|
||||
mysql_user:
|
||||
|
@ -229,8 +227,6 @@
|
|||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
when: (install_type == 'mysql' and mysql_version is version('8', '<')) or
|
||||
(install_type == 'mariadb')
|
||||
|
||||
- name: Collect user info by host
|
||||
community.mysql.mysql_info:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue