mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-25 11:51:27 -07:00
* Display a more informative error when InvalidPrivsError is raised (Issue #465) Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
This commit is contained in:
parent
4dac66382a
commit
6ac89ca1f6
8 changed files with 62 additions and 1 deletions
|
@ -4,3 +4,5 @@
|
|||
src: installed_file.j2
|
||||
dest: "{{ dbdeployer_installed_file }}"
|
||||
listen: create zookeeper installed file
|
||||
tags:
|
||||
- setup_mysql
|
||||
|
|
|
@ -5,7 +5,17 @@
|
|||
####################################################################
|
||||
|
||||
- import_tasks: setvars.yml
|
||||
tags:
|
||||
- setup_mysql
|
||||
- import_tasks: dir.yml
|
||||
tags:
|
||||
- setup_mysql
|
||||
- import_tasks: install.yml
|
||||
tags:
|
||||
- setup_mysql
|
||||
- import_tasks: config.yml
|
||||
tags:
|
||||
- setup_mysql
|
||||
- import_tasks: verify.yml
|
||||
tags:
|
||||
- setup_mysql
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
- name: delete temporary directory
|
||||
include_tasks: default-cleanup.yml
|
||||
tags:
|
||||
- setup_remote_tmp_dir
|
||||
|
||||
- name: delete temporary directory (windows)
|
||||
include_tasks: windows-cleanup.yml
|
||||
tags:
|
||||
- setup_remote_tmp_dir
|
||||
|
|
|
@ -7,9 +7,13 @@
|
|||
setup:
|
||||
gather_subset: distribution
|
||||
when: ansible_facts == {}
|
||||
tags:
|
||||
- setup_remote_tmp_dir
|
||||
|
||||
- include_tasks: "{{ lookup('first_found', files)}}"
|
||||
vars:
|
||||
files:
|
||||
- "{{ ansible_os_family | lower }}.yml"
|
||||
- "default.yml"
|
||||
tags:
|
||||
- setup_remote_tmp_dir
|
||||
|
|
|
@ -281,6 +281,10 @@
|
|||
- include: test_priv_subtract.yml enable_check_mode=no
|
||||
- include: test_priv_subtract.yml enable_check_mode=yes
|
||||
|
||||
- import_tasks: test_privs_issue_465.yml
|
||||
tags:
|
||||
- issue_465
|
||||
|
||||
# Tests for the TLS requires dictionary
|
||||
- include: tls_requirements.yml
|
||||
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
# test code for privileges for mysql_user module - issue 465
|
||||
|
||||
- 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: create a user with parameters that will always cause an exception
|
||||
mysql_user:
|
||||
<<: *mysql_params
|
||||
name: user_issue_465
|
||||
password: a_test_password_465
|
||||
priv: '*.{{ db_name }}:SELECT'
|
||||
state: present
|
||||
ignore_errors: true
|
||||
register: result
|
||||
|
||||
- name: assert output message for current privileges
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
- result.msg is search('invalid priv string')
|
||||
- result.msg is search('params')
|
||||
- result.msg is search('query')
|
||||
- result.msg is search('exception')
|
Loading…
Add table
Add a link
Reference in a new issue