mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-05 10:10:32 -07:00
40 lines
1.3 KiB
YAML
40 lines
1.3 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"]
|