mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-22 12:50:24 -07:00
mysql_user: add session_vars argument (#489)
* mysql_user: add session_vars argument * Update tests/integration/targets/test_mysql_user/tasks/main.yml Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
c242584bae
commit
930a5a5d49
4 changed files with 54 additions and 1 deletions
|
@ -62,6 +62,8 @@
|
|||
name: '{{user_name_1}}'
|
||||
password: '{{user_password_1}}'
|
||||
state: present
|
||||
session_vars:
|
||||
sort_buffer_size: 1024
|
||||
register: result
|
||||
|
||||
- name: assert output message mysql user was not created
|
||||
|
@ -69,6 +71,24 @@
|
|||
that:
|
||||
- result is not changed
|
||||
|
||||
# Try to set wrong session variable, must fail
|
||||
- name: create mysql user trying to set global variable which is forbidden
|
||||
mysql_user:
|
||||
<<: *mysql_params
|
||||
name: '{{user_name_1}}'
|
||||
password: '{{user_password_1}}'
|
||||
state: present
|
||||
session_vars:
|
||||
max_connections: 1000
|
||||
register: result
|
||||
ignore_errors: true
|
||||
|
||||
- name: we cannot set a global variable
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
- result.msg is search('is a GLOBAL variable')
|
||||
|
||||
# ============================================================
|
||||
# remove mysql user and verify user is removed from mysql database
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue