mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-25 14:20:24 -07:00
Generalize mysql and mariadb version based on container name
This way we can split db_engine and db_version and simplify tests. Also this is mandatory to use the matrix.db_engine_version as the image name for our services containers.
This commit is contained in:
parent
90266f1ad5
commit
b821db97c5
13 changed files with 158 additions and 190 deletions
35
.github/workflows/ansible-test-plugins.yml
vendored
35
.github/workflows/ansible-test-plugins.yml
vendored
|
@ -15,8 +15,7 @@ on:
|
|||
|
||||
|
||||
env:
|
||||
mysql_version_file: "tests/integration/targets/setup_mysql/defaults/main.yml"
|
||||
connector_version_file: "tests/integration/targets/setup_mysql/vars/main.yml"
|
||||
config_file: "tests/integration/targets/setup_mysql/defaults/main.yml"
|
||||
|
||||
jobs:
|
||||
# sanity:
|
||||
|
@ -44,13 +43,12 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# db_engine_version:
|
||||
# - mysql_5.7.31
|
||||
# - mysql_8.0.22
|
||||
# - mariadb_10.3.34
|
||||
# # When adding later versions below,
|
||||
# # also change the "Set MariaDB URL sub dir" task
|
||||
# - mariadb_10.8.3
|
||||
db_engine_version:
|
||||
# - mysql:5.7.40
|
||||
- mysql:8.0.22
|
||||
# - mariadb:10.4.24
|
||||
# - mariadb:10.5.18
|
||||
# - mariadb:10.8.3
|
||||
ansible:
|
||||
# - stable-2.12
|
||||
# - stable-2.13
|
||||
|
@ -88,10 +86,9 @@ jobs:
|
|||
|
||||
services:
|
||||
db_primary:
|
||||
# image: mariadb:10.5
|
||||
image: mysql:8.0.22
|
||||
image: ${{ matrix.db_engine_version }}
|
||||
env:
|
||||
# MARIADB_ROOT_PASSWORD: msandbox
|
||||
MARIADB_ROOT_PASSWORD: msandbox
|
||||
MYSQL_ROOT_PASSWORD: msandbox
|
||||
ports:
|
||||
- 3307:3306
|
||||
|
@ -106,10 +103,9 @@ jobs:
|
|||
# --health-timeout 5s
|
||||
# --health-retries 6
|
||||
db_replica1:
|
||||
# image: mariadb:10.5
|
||||
image: mysql:8.0.22
|
||||
image: ${{ matrix.db_engine_version }}
|
||||
env:
|
||||
# MARIADB_ROOT_PASSWORD: msandbox
|
||||
MARIADB_ROOT_PASSWORD: msandbox
|
||||
MYSQL_ROOT_PASSWORD: msandbox
|
||||
ports:
|
||||
- 3308:3306
|
||||
|
@ -122,10 +118,9 @@ jobs:
|
|||
# --health-timeout 5s
|
||||
# --health-retries 6
|
||||
db_replica2:
|
||||
# image: mariadb:10.5
|
||||
image: mysql:8.0.22
|
||||
image: ${{ matrix.db_engine_version }}
|
||||
env:
|
||||
# MARIADB_ROOT_PASSWORD: msandbox
|
||||
MARIADB_ROOT_PASSWORD: msandbox
|
||||
MYSQL_ROOT_PASSWORD: msandbox
|
||||
ports:
|
||||
- 3309:3306
|
||||
|
@ -147,8 +142,10 @@ jobs:
|
|||
with:
|
||||
ansible-core-version: ${{ matrix.ansible }}
|
||||
pre-test-cmd: >-
|
||||
>&2 echo Setting db_engine_version to ${{ matrix.db_engine_version }}...;
|
||||
sed -i 's/^db_engine_version:.*/db_engine_version: [${{ matrix.db_engine_version }}]/' ${{ env.config_file }}
|
||||
>&2 echo Setting Connector version to ${{ matrix.connector }}...;
|
||||
sed -i 's/^python_packages:.*/python_packages: [${{ matrix.connector }}]/' ${{ env.connector_version_file }}
|
||||
sed -i 's/^python_packages:.*/python_packages: [${{ matrix.connector }}]/' ${{ env.config_file }}
|
||||
target-python-version: ${{ matrix.python }}
|
||||
testing-type: integration
|
||||
|
||||
|
|
|
@ -1,18 +1,5 @@
|
|||
dbdeployer_version: 1.64.0
|
||||
dbdeployer_home_dir: /opt/dbdeployer
|
||||
|
||||
---
|
||||
home_dir: "{{ playbook_dir }}/root"
|
||||
|
||||
mariadb_install: false
|
||||
|
||||
mysql_version: 8.0.22
|
||||
mariadb_version: 10.5.4
|
||||
|
||||
db_engine_version: mysql:8.0.22
|
||||
mysql_base_port: 3306
|
||||
|
||||
percona_client_package: >-
|
||||
{%- if mariadb_install -%}
|
||||
mariadb-client
|
||||
{%- else -%}
|
||||
percona-server-client-5.7
|
||||
{%- endif -%}
|
||||
python_packages: [pymysql == 0.9.3]
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
ansible.builtin.set_fact:
|
||||
connector_name: "{{ connector.name.0 }}"
|
||||
gateway_addr: "{{ ip_route_output.stdout }}"
|
||||
db_engine: "{{ db_engine_version | split(':') | first }}"
|
||||
db_version: "{{ db_engine_version | split(':') | last }}"
|
||||
|
||||
- name: "{{ role_name }} | setvars | Set Fact using above facts"
|
||||
ansible.builtin.set_fact:
|
||||
|
@ -26,3 +28,4 @@
|
|||
msg: >
|
||||
Connector name: {{ connector_name }},
|
||||
Connector version: {{ connector_ver }}
|
||||
db_engine: {{ db_engine }}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
dbdeployer_install_dir: "{{ dbdeployer_home_dir }}/dbdeployer_{{ dbdeployer_version }}"
|
||||
dbdeployer_src: "https://github.com/datacharmer/dbdeployer/releases/download/v{{ dbdeployer_version }}/dbdeployer-{{ dbdeployer_version }}.linux.tar.gz"
|
||||
dbdeployer_installed_file: "{{ dbdeployer_home_dir }}/dbdeployer_installed"
|
||||
|
||||
dbdeployer_sandbox_download_dir: "{{ home_dir }}/downloads"
|
||||
dbdeployer_sandbox_binary_dir: "{{ home_dir }}/opt/mysql"
|
||||
dbdeployer_sandbox_home_dir: "{{ home_dir }}/sandboxes"
|
||||
|
||||
percona_mysql_packages:
|
||||
- "{{ percona_client_package }}"
|
||||
|
||||
python_packages: [pymysql == 0.9.3]
|
||||
|
||||
mysql_tarball: "mysql-{{ mysql_version }}-linux-glibc2.12-x86_64.tar.{{ mysql_compression_extension }}"
|
||||
mysql_src: "https://dev.mysql.com/get/Downloads/MySQL-{{ mysql_major_version }}/{{ mysql_tarball }}"
|
||||
mariadb_url_subdir: "linux"
|
||||
mariadb_tarball: "mariadb-{{ mariadb_version }}-{{ mariadb_url_subdir }}-x86_64.tar.gz"
|
||||
mariadb_src: "https://downloads.mariadb.com/MariaDB/mariadb-{{ mariadb_version }}/bintar-{{ mariadb_url_subdir }}-x86_64/{{ mariadb_tarball }}"
|
|
@ -48,13 +48,13 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
- "mysql_version in result.version.full or mariadb_version in result.version.full"
|
||||
- result.settings != {}
|
||||
- result.global_status != {}
|
||||
- result.databases != {}
|
||||
- result.engines != {}
|
||||
- result.users != {}
|
||||
- result is not changed
|
||||
- db_version in result.version.full
|
||||
- result.settings != {}
|
||||
- result.global_status != {}
|
||||
- result.databases != {}
|
||||
- result.engines != {}
|
||||
- result.users != {}
|
||||
|
||||
# Access by non-default cred file
|
||||
- name: mysql_info - check non-default cred file
|
||||
|
|
|
@ -90,11 +90,11 @@
|
|||
|
||||
- name: Create replication filter MySQL
|
||||
shell: "echo \"CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB = (mysql);\" | {{ mysql_command }} -P{{ mysql_replica1_port }}"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Create replication filter MariaDB
|
||||
shell: "echo \"SET GLOBAL replicate_ignore_db = 'mysql';\" | {{ mysql_command }} -P{{ mysql_replica1_port }}"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Start replica
|
||||
mysql_replication:
|
||||
|
@ -155,8 +155,8 @@
|
|||
|
||||
- name: Remove replication filter MySQL
|
||||
shell: "echo \"CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB = ();\" | {{ mysql_command }} -P{{ mysql_replica1_port }}"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Remove replication filter MariaDB
|
||||
shell: "echo \"SET GLOBAL replicate_ignore_db = '';\" | {{ mysql_command }} -P{{ mysql_replica1_port }}"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# Tests of channel parameter:
|
||||
- import_tasks: mysql_replication_channel.yml
|
||||
when:
|
||||
- install_type == 'mysql' # FIXME: mariadb introduces FOR CHANNEL in 10.7
|
||||
- db_engine == 'mysql' # FIXME: mariadb introduces FOR CHANNEL in 10.7
|
||||
|
||||
# Tests of resetprimary mode:
|
||||
- import_tasks: mysql_replication_resetprimary_mode.yml
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
mysql8022_and_higher: true
|
||||
when:
|
||||
- db.version.major > 8 or (db.version.major == 8 and db.version.minor > 0) or (db.version.major == 8 and db.version.minor == 0 and db.version.release >= 22)
|
||||
- install_type == 'mysql'
|
||||
- db_engine == 'mysql'
|
||||
|
||||
- name: alias mysql command to include default options except for the port
|
||||
set_fact:
|
||||
|
@ -33,11 +33,11 @@
|
|||
# Preparation:
|
||||
- name: Create user for mysql replication
|
||||
shell: "echo \"CREATE USER '{{ replication_user }}'@'localhost' IDENTIFIED WITH mysql_native_password BY '{{ replication_pass }}'; GRANT REPLICATION SLAVE ON *.* TO '{{ replication_user }}'@'localhost';\" | {{ mysql_command_wo_port }} -P{{ mysql_primary_port }}"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Create user for mariadb replication
|
||||
shell: "echo \"CREATE USER '{{ replication_user }}'@'localhost' IDENTIFIED BY '{{ replication_pass }}'; GRANT REPLICATION SLAVE ON *.* TO '{{ replication_user }}'@'localhost';\" | {{ mysql_command_wo_port }} -P{{ mysql_primary_port }}"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Create test database
|
||||
mysql_db:
|
||||
|
|
|
@ -105,26 +105,26 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 0
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
#=====================
|
||||
|
||||
|
@ -172,26 +172,26 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check that the role is active
|
||||
<<: *task_params
|
||||
|
@ -201,13 +201,13 @@
|
|||
login_host: '{{ gateway_addr }}'
|
||||
login_port: '{{ mysql_primary_port }}'
|
||||
query: 'SELECT current_role()'
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- "'{{ role0 }}' in result.query_result.0.0['current_role()']"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check that the role is active (mariadb)
|
||||
<<: *task_params
|
||||
|
@ -219,13 +219,13 @@
|
|||
query:
|
||||
- 'SET ROLE {{ role0 }}'
|
||||
- 'SELECT current_role()'
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- "'{{ role0 }}' in result.query_result.1.0['current_role()']"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
#========================
|
||||
|
||||
|
@ -258,26 +258,26 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
#========================
|
||||
|
||||
|
@ -336,13 +336,13 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
# Must pass because of check_mode
|
||||
- name: Check in DB (mariadb)
|
||||
|
@ -350,13 +350,13 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
#========================
|
||||
|
||||
|
@ -389,13 +389,13 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
|
@ -403,13 +403,13 @@
|
|||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 0
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
#========================
|
||||
|
||||
|
@ -573,13 +573,13 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
# user0 is still a member because of check_mode
|
||||
- name: Check in DB (mariadb)
|
||||
|
@ -587,13 +587,13 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
# user1, user2, and role1 are not members because of check_mode
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
|
@ -602,26 +602,26 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user1 }}@localhost USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user1 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 0
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
|
@ -629,26 +629,26 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user2 }}@localhost USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user2 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 0
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
|
@ -656,26 +656,26 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ role1 }} USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ role1 }}' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 0
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
#========================
|
||||
|
||||
|
@ -702,13 +702,13 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
# user0 is not a member any more
|
||||
- name: Check in DB (mariadb)
|
||||
|
@ -716,65 +716,65 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- "'{{ role0 }}' not in result.query_result.0.0['Grants for user0@localhost']"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user1 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user1 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user2 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user2 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
|
@ -782,26 +782,26 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ role1 }} USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ role1 }}' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
|
||||
#==========================
|
||||
|
@ -866,26 +866,26 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 0
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
#=====================
|
||||
|
||||
- name: Append a member
|
||||
|
@ -908,26 +908,26 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
# user1 and user2 must still be in DB because we are appending
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
|
@ -935,52 +935,52 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user1 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user1 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user2 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user2 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
#========================
|
||||
|
||||
|
@ -1042,78 +1042,78 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user1 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user1 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user2 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user2 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
#========================
|
||||
|
||||
|
@ -1138,26 +1138,26 @@
|
|||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user0 }}@localhost USING '{{ role0 }}'"
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user0 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
|
@ -1165,26 +1165,26 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user1 }}@localhost USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user1 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 0
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB, if not granted, the query will fail
|
||||
<<: *task_params
|
||||
|
@ -1192,26 +1192,26 @@
|
|||
<<: *mysql_params
|
||||
query: "SHOW GRANTS FOR {{ user2 }}@localhost USING '{{ role0 }}'"
|
||||
ignore_errors: yes
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check in DB (mariadb)
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT count(User) as user_roles FROM mysql.roles_mapping WHERE User = '{{ user2 }}' AND Host = 'localhost' AND Role = '{{ role0 }}'"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0['user_roles'] == 0
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
#=====================
|
||||
|
||||
|
@ -1374,7 +1374,7 @@
|
|||
- result.query_result.0.0["Grants for role0@%"] == "GRANT SELECT, INSERT ON *.* TO `role0`@`%`"
|
||||
- result.query_result.0.1["Grants for role0@%"] == "GRANT UPDATE ON `mysql`.* TO `role0`@`%`"
|
||||
- result.rowcount.0 == 2
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
|
@ -1382,7 +1382,7 @@
|
|||
- result.query_result.0.0["Grants for role0"] == "GRANT SELECT, INSERT ON *.* TO `role0`"
|
||||
- result.query_result.0.1["Grants for role0"] == "GRANT UPDATE ON `mysql`.* TO `role0`"
|
||||
- result.rowcount.0 == 2
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Append privs in check_mode
|
||||
<<: *task_params
|
||||
|
@ -1411,7 +1411,7 @@
|
|||
- result.query_result.0.0["Grants for role0@%"] == "GRANT SELECT, INSERT ON *.* TO `role0`@`%`"
|
||||
- result.query_result.0.1["Grants for role0@%"] == "GRANT UPDATE ON `mysql`.* TO `role0`@`%`"
|
||||
- result.rowcount.0 == 2
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
|
@ -1419,7 +1419,7 @@
|
|||
- result.query_result.0.0["Grants for role0"] == "GRANT SELECT, INSERT ON *.* TO `role0`"
|
||||
- result.query_result.0.1["Grants for role0"] == "GRANT UPDATE ON `mysql`.* TO `role0`"
|
||||
- result.rowcount.0 == 2
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Append privs
|
||||
<<: *task_params
|
||||
|
@ -1449,7 +1449,7 @@
|
|||
- result.query_result.0.2["Grants for role0@%"] == "GRANT SELECT, INSERT ON `test_db1`.`test_table` TO `role0`@`%`"
|
||||
- result.query_result.0.3["Grants for role0@%"] == "GRANT DELETE ON `test_db2`.`test_table` TO `role0`@`%`"
|
||||
- result.rowcount.0 == 4
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
|
@ -1459,7 +1459,7 @@
|
|||
- result.query_result.0.2["Grants for role0"] == "GRANT SELECT, INSERT ON `test_db1`.`test_table` TO `role0`"
|
||||
- result.query_result.0.3["Grants for role0"] == "GRANT DELETE ON `test_db2`.`test_table` TO `role0`"
|
||||
- result.rowcount.0 == 4
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Append privs again in check_mode
|
||||
<<: *task_params
|
||||
|
@ -1521,14 +1521,14 @@
|
|||
that:
|
||||
- result.query_result.0.0["Grants for role0@%"] == "GRANT SELECT ON *.* TO `role0`@`%`"
|
||||
- result.rowcount.0 == 1
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check (mariadb)
|
||||
assert:
|
||||
that:
|
||||
- result.query_result.0.0["Grants for role0"] == "GRANT SELECT ON *.* TO `role0`"
|
||||
- result.rowcount.0 == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
# #################
|
||||
# Test admin option
|
||||
|
@ -1555,26 +1555,26 @@
|
|||
that:
|
||||
- result is failed
|
||||
- result.msg is search('option can be used only with MariaDB')
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check with MariaDB
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check in DB
|
||||
<<: *task_params
|
||||
mysql_query:
|
||||
<<: *mysql_params
|
||||
query: "SELECT 1 FROM mysql.user WHERE User = '{{ role0 }}' AND Host = ''"
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Check
|
||||
assert:
|
||||
that:
|
||||
- result.rowcount.0 == 1
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
- name: Create role with admin again
|
||||
<<: *task_params
|
||||
|
@ -1590,13 +1590,13 @@
|
|||
that:
|
||||
- result is failed
|
||||
- result.msg is search('option can be used only with MariaDB')
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
- name: Check with MariaDB
|
||||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
when: install_type == 'mariadb'
|
||||
when: db_engine == 'mariadb'
|
||||
|
||||
# Try to grant a role to a user who does not exist
|
||||
- name: Create role with admin again
|
||||
|
|
|
@ -243,7 +243,7 @@
|
|||
#
|
||||
# FIXME: mariadb sql syntax for create/update user is not compatible
|
||||
- include: test_user_plugin_auth.yml
|
||||
when: install_type == 'mysql'
|
||||
when: db_engine == 'mysql'
|
||||
|
||||
# ============================================================
|
||||
# Assert create user with SELECT privileges, attempt to create database and update privileges to create database
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
assert:
|
||||
that:
|
||||
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
||||
when: install_type == 'mysql' or (install_type == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
|
||||
- include: assert_user.yml user_name={{ test_user_name }} priv={{ test_default_priv_type }}
|
||||
|
||||
|
@ -119,7 +119,7 @@
|
|||
assert:
|
||||
that:
|
||||
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
||||
when: install_type == 'mysql' or (install_type == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
|
||||
- include: assert_user.yml user_name={{ test_user_name }} priv={{ test_default_priv_type }}
|
||||
|
||||
|
@ -150,7 +150,7 @@
|
|||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
when: install_type == 'mysql' or (install_type == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
|
||||
- include: assert_user.yml user_name={{ test_user_name }} priv={{ test_default_priv_type }}
|
||||
|
||||
|
@ -211,7 +211,7 @@
|
|||
assert:
|
||||
that:
|
||||
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
||||
when: install_type == 'mysql' or (install_type == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
|
||||
- include: assert_user.yml user_name={{ test_user_name }} priv={{ test_default_priv_type }}
|
||||
|
||||
|
@ -301,7 +301,7 @@
|
|||
assert:
|
||||
that:
|
||||
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
||||
when: install_type == 'mysql' or (install_type == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
|
||||
- include: assert_user.yml user_name={{ test_user_name }} priv={{ test_default_priv_type }}
|
||||
|
||||
|
@ -387,7 +387,7 @@
|
|||
assert:
|
||||
that:
|
||||
- "'{{ test_plugin_type }}' in show_create_user.stdout"
|
||||
when: install_type == 'mysql' or (install_type == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
|
||||
- include: assert_user.yml user_name={{ test_user_name }} priv={{ test_default_priv_type }}
|
||||
|
||||
|
@ -412,7 +412,7 @@
|
|||
assert:
|
||||
that:
|
||||
- "'sha256_password' in show_create_user.stdout"
|
||||
when: install_type == 'mysql' or (install_type == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
when: db_engine == 'mysql' or (db_engine == 'mariadb' and mariadb_version is version('10.3', '>='))
|
||||
|
||||
- include: assert_user.yml user_name={{ test_user_name }} priv={{ test_default_priv_type }}
|
||||
|
||||
|
|
|
@ -356,8 +356,8 @@
|
|||
- include: assert_var.yml changed=true output={{ result }} var_name={{ set_name }} var_value='{{ def_val }}'
|
||||
|
||||
when:
|
||||
- mysql_version is version('8.0', '>=')
|
||||
- install_type == 'mysql'
|
||||
- db_engine == 'mysql'
|
||||
- db_version is version('8.0', '>=')
|
||||
|
||||
# Bugfix of https://github.com/ansible/ansible/issues/54239
|
||||
# - name: set variable containing dot
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
- "mysql_version in result.version.full or mariadb_version in result.version.full"
|
||||
- db_version in result.version.full
|
||||
- result.settings != {}
|
||||
- result.global_status != {}
|
||||
- result.databases != {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue