mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2026-02-04 07:11:49 +00:00
* Fix ssl verification always enabled for replication even if set to false
* add changelog fragment
* fix test when multiple replication channels are present
* test: add check for changereplication
* fix mismatch default value
We use "None" as a default to know if the user provide this option
or not. But a bool can't have a default of "None" for the sanity tests.
So we must erase the line.
* doc: add var name used by MySQL and MariaDB
* Revert the change of default value
* style
* fix indentation
* Revert "Revert the change of default value"
This reverts commit db047fda90.
* add changelog about changed default value
* add link to issue and PR in changelog
* doc: explain false had no effect prior to 3.14.0
62 lines
2.1 KiB
YAML
62 lines
2.1 KiB
YAML
---
|
|
|
|
- vars:
|
|
mysql_parameters: &mysql_params
|
|
login_user: '{{ mysql_user }}'
|
|
login_password: '{{ mysql_password }}'
|
|
login_host: '{{ mysql_host }}'
|
|
login_port: '{{ mysql_primary_port }}'
|
|
block:
|
|
|
|
- name: Disable ssl verification
|
|
community.mysql.mysql_replication:
|
|
<<: *mysql_params
|
|
login_port: '{{ mysql_replica1_port }}'
|
|
mode: changeprimary
|
|
primary_ssl_verify_server_cert: false
|
|
register: result
|
|
|
|
- name: Assert that changeprimmary is changed and return expected query for MariaDB and MySQL < 8.0.23
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result is changed
|
|
- result.queries == expected_queries
|
|
when:
|
|
- >
|
|
db_engine == 'mariadb' or
|
|
(db_engine == 'mysql' and db_version is version('8.0.23', '<'))
|
|
vars:
|
|
expected_queries: ["CHANGE MASTER TO MASTER_SSL_VERIFY_SERVER_CERT=0"]
|
|
|
|
- name: Assert that changeprimmary is changed and return expected query for MySQL > 8.0.23
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result is changed
|
|
- result.queries == expected_queries
|
|
when:
|
|
- db_engine == 'mysql'
|
|
- db_version is version('8.0.23', '>=')
|
|
vars:
|
|
expected_queries: ["CHANGE REPLICATION SOURCE TO SOURCE_SSL_VERIFY_SERVER_CERT=0"]
|
|
|
|
- name: Disable ssl verification for MySQL 8.0.23+
|
|
community.mysql.mysql_replication:
|
|
<<: *mysql_params
|
|
login_port: '{{ mysql_replica1_port }}'
|
|
mode: changereplication
|
|
primary_ssl_verify_server_cert: false
|
|
register: result
|
|
when:
|
|
- db_engine == 'mysql'
|
|
- db_version is version('8.0.23', '>=')
|
|
|
|
- name: Assert that changereplication is changed and return expected query for MySQL > 8.0.23
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result is changed
|
|
- result.queries == expected_queries
|
|
when:
|
|
- db_engine == 'mysql'
|
|
- db_version is version('8.0.23', '>=')
|
|
vars:
|
|
expected_queries: ["CHANGE REPLICATION SOURCE TO SOURCE_SSL_VERIFY_SERVER_CERT=0"]
|