mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-07 03:00:34 -07:00
* Is changed (#427)
* Refactor tests to use "is" and "is not" changed
* Refactor tests to use is succeeded or is failed
* Reformat indentation
* Add filter "bool" to prevent issues
(cherry picked from commit 0a68bb270f
)
* Fix error message verification
I don't know why this works on main, but in stable-1, the error message
is "invalid privileges string: Invalid privileges specified:
frozenset({'INVALID'})"
* Add filter for test that won't work with mariadb
* Refactor test in their own file instead of main
* Add db_names dict
* Fix registered variable name
* Add missing fact
* Add test databases cleanup
* Cut tests for unsupported db name (%)
* Add missing default vars to tests db_formats
* Backport small diff from main
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
---
|
|
- 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: Set root password
|
|
mysql_user:
|
|
<<: *mysql_params
|
|
name: root
|
|
password: '{{ root_password }}'
|
|
check_implicit_admin: yes
|
|
register: result
|
|
|
|
- name: assert root password is changed
|
|
assert:
|
|
that:
|
|
- result is changed
|
|
|
|
- name: Set root password again
|
|
mysql_user:
|
|
login_user: '{{ mysql_user }}'
|
|
login_password: '{{ root_password }}'
|
|
login_host: 127.0.0.1
|
|
login_port: '{{ mysql_primary_port }}'
|
|
name: root
|
|
password: '{{ root_password }}'
|
|
check_implicit_admin: yes
|
|
register: result
|
|
|
|
- name: Assert root password is not changed
|
|
assert:
|
|
that:
|
|
- result is not changed
|
|
|
|
- name: Set root password again
|
|
mysql_user:
|
|
login_user: '{{ mysql_user }}'
|
|
login_password: '{{ root_password }}'
|
|
login_host: 127.0.0.1
|
|
login_port: '{{ mysql_primary_port }}'
|
|
name: root
|
|
password: '{{ mysql_password }}'
|
|
check_implicit_admin: yes
|
|
register: result
|