mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-27 23:21:27 -07:00
Backport/stable 2/pr 452 (#463)
* Sync GHA workflow w/ the collection template (#452) * Sync GHA workflow w/ the collection template * Drop the trailing pre-cmd semicolon * Recover missing `-e` flag of `sed` * Use relative paths for version configs * Unquote `env.connector_version_file` * Use string formatting to fix the substitution problem (cherry picked from commit8107530744
) * Backport mysql_version_parts variable assignation (cherry picked from commit79046a88cb
) * Add changelog fragment * Backport flags and variables to differentiate MariaDB from MySQL setup * Backport issue-28 check for tls support * Backport tls_requirements simplified and deduplified tests Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
This commit is contained in:
parent
1f42f39d92
commit
8949c68929
16 changed files with 150 additions and 126 deletions
|
@ -1,11 +1,21 @@
|
|||
---
|
||||
- name: alias mysql command to include default options
|
||||
set_fact:
|
||||
mysql_command: "mysql -u{{ mysql_user }} -p{{ mysql_password }} -P{{ mysql_primary_port }} --protocol=tcp"
|
||||
|
||||
- name: set fact tls_enabled
|
||||
command: "{{ mysql_command }} \"-e SHOW VARIABLES LIKE 'have_ssl';\""
|
||||
register: result
|
||||
- set_fact:
|
||||
tls_enabled: "{{ 'YES' in result.stdout | bool | default('false', true) }}"
|
||||
|
||||
- vars:
|
||||
mysql_parameters: &mysql_params
|
||||
login_user: '{{ mysql_user }}'
|
||||
login_password: '{{ mysql_password }}'
|
||||
login_host: 127.0.0.1
|
||||
login_port: '{{ mysql_primary_port }}'
|
||||
|
||||
when: tls_enabled
|
||||
block:
|
||||
|
||||
# ============================================================
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
# Tests of channel parameter:
|
||||
- import_tasks: mysql_replication_channel.yml
|
||||
when:
|
||||
- install_type == 'mysql' # FIXME: mariadb introduces FOR CHANNEL in 10.7
|
||||
|
||||
# Tests of resetprimary mode:
|
||||
- import_tasks: mysql_replication_resetprimary_mode.yml
|
||||
|
|
|
@ -24,14 +24,20 @@
|
|||
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'
|
||||
|
||||
- name: alias mysql command to include default options
|
||||
set_fact:
|
||||
mysql_command: "mysql -u{{ mysql_user }} -p{{ mysql_password }} --protocol=tcp"
|
||||
|
||||
# Preparation:
|
||||
- name: Create user for replication
|
||||
- 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 }} -P{{ mysql_primary_port }}"
|
||||
when: install_type == '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 }} -P{{ mysql_primary_port }}"
|
||||
when: install_type == 'mariadb'
|
||||
|
||||
- name: Create test database
|
||||
mysql_db:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue