mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-03 20:54:25 -07:00
Make 'when' conditions uniform
This commit is contained in:
parent
f7d860ac8c
commit
66cf9dd369
1 changed files with 7 additions and 21 deletions
|
@ -1490,34 +1490,26 @@
|
||||||
that:
|
that:
|
||||||
- result is failed
|
- result is failed
|
||||||
- result.msg is search('option can be used only with MariaDB')
|
- result.msg is search('option can be used only with MariaDB')
|
||||||
when:
|
when: install_type == 'mysql'
|
||||||
# Semantically, when there's MySQL
|
|
||||||
- srv['version']['major'] < 10
|
|
||||||
|
|
||||||
- name: Check with MariaDB
|
- name: Check with MariaDB
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
when:
|
when: install_type == 'mariadb'
|
||||||
# Semantically, when there's MariaDB
|
|
||||||
- srv['version']['major'] >= 10
|
|
||||||
|
|
||||||
- name: Check in DB
|
- name: Check in DB
|
||||||
<<: *task_params
|
<<: *task_params
|
||||||
mysql_query:
|
mysql_query:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
query: "SELECT 1 FROM mysql.user WHERE User = '{{ role0 }}' AND Host = '%'"
|
query: "SELECT 1 FROM mysql.user WHERE User = '{{ role0 }}' AND Host = '%'"
|
||||||
when:
|
when: install_type == 'mariadb'
|
||||||
# Semantically, when there's MariaDB
|
|
||||||
- srv['version']['major'] >= 10
|
|
||||||
|
|
||||||
- name: Check
|
- name: Check
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result.rowcount.0 == 1
|
- result.rowcount.0 == 1
|
||||||
when:
|
when: install_type == 'mariadb'
|
||||||
# Semantically, when there's MariaDB
|
|
||||||
- srv['version']['major'] >= 10
|
|
||||||
|
|
||||||
- name: Create role with admin again
|
- name: Create role with admin again
|
||||||
<<: *task_params
|
<<: *task_params
|
||||||
|
@ -1533,17 +1525,13 @@
|
||||||
that:
|
that:
|
||||||
- result is failed
|
- result is failed
|
||||||
- result.msg is search('option can be used only with MariaDB')
|
- result.msg is search('option can be used only with MariaDB')
|
||||||
when:
|
when: install_type == 'mysql'
|
||||||
# Semantically, when there's MySQL
|
|
||||||
- srv['version']['major'] < 10
|
|
||||||
|
|
||||||
- name: Check with MariaDB
|
- name: Check with MariaDB
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result is not changed
|
- result is not changed
|
||||||
# Semantically, when there's MariaDB
|
when: install_type == 'mariadb'
|
||||||
when:
|
|
||||||
- srv['version']['major'] >= 10
|
|
||||||
|
|
||||||
# Try to grant a role to a user who does not exist
|
# Try to grant a role to a user who does not exist
|
||||||
- name: Create role with admin again
|
- name: Create role with admin again
|
||||||
|
@ -1561,9 +1549,7 @@
|
||||||
that:
|
that:
|
||||||
- result is failed
|
- result is failed
|
||||||
- result.msg is search('does not exist')
|
- result.msg is search('does not exist')
|
||||||
when:
|
when: install_type == 'mysql'
|
||||||
# Semantically, when there's MySQL
|
|
||||||
- srv['version']['major'] < 10
|
|
||||||
|
|
||||||
always:
|
always:
|
||||||
# Clean up
|
# Clean up
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue