generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix * test * changelog
- Loading branch information
Showing
4 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- mysql_user - when revoke privs consists only of ``GRANT``, a 2nd revoke query is executed with empty privs to revoke that ended in an SQL exception (https://github.com/ansible-collections/community.mysql/pull/503). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
tests/integration/targets/test_mysql_user/tasks/revoke_only_grant.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
- vars: | ||
mysql_parameters: &mysql_params | ||
login_user: '{{ mysql_user }}' | ||
login_password: '{{ mysql_password }}' | ||
login_host: 127.0.0.1 | ||
login_port: '{{ mysql_primary_port }}' | ||
block: | ||
- name: Drop mysql user if exists | ||
mysql_user: | ||
<<: *mysql_params | ||
name: '{{ user_name_1 }}' | ||
state: absent | ||
ignore_errors: true | ||
|
||
- name: create user with two grants | ||
mysql_user: | ||
<<: *mysql_params | ||
name: "{{ user_name_1 }}" | ||
password: "{{ user_password_1 }}" | ||
update_password: on_create | ||
priv: '*.*:SELECT,GRANT' | ||
|
||
- name: user must have only on priv, grant priv must be dropped | ||
register: result | ||
mysql_user: | ||
<<: *mysql_params | ||
name: "{{ user_name_1 }}" | ||
password: "{{ user_password_1 }}" | ||
update_password: on_create | ||
priv: '*.*:SELECT' | ||
|
||
- assert: | ||
that: | ||
- result is not failed | ||
- result is changed | ||
|
||
- name: immutable - user must have only on priv, grant priv must be dropped | ||
register: result | ||
mysql_user: | ||
<<: *mysql_params | ||
name: "{{ user_name_1 }}" | ||
password: "{{ user_password_1 }}" | ||
update_password: on_create | ||
priv: '*.*:SELECT' | ||
|
||
- assert: | ||
that: | ||
- result is not failed | ||
- result is not changed | ||
|
||
always: | ||
- name: drop user | ||
mysql_user: | ||
<<: *mysql_params | ||
name: '{{ user_name_1 }}' | ||
state: absent | ||
ignore_errors: true |