aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeunghun Lee <seunghun@stackhpc.com>2026-09-24 14:00:23 +0100
committerSeunghun Lee <seunghun@stackhpc.com>2026-09-25 12:42:02 +0000
commited01be2239b37fc84a8d7843e4e6c9bd57ca1303 (patch)
tree6b883fd8179a4dfb444bfc11384aed9dbbe3b465
parent870c2d61b27cdbabc2e3eb799f8752e9413842df (diff)
downloadkolla-ansible-ed01be2239b37fc84a8d7843e4e6c9bd57ca1303.tar.gz
kolla-ansible-ed01be2239b37fc84a8d7843e4e6c9bd57ca1303.zip
Include CA for database TLS on MariaDB backup
When database backend TLS was implemented [1], the CA was not set for Mariabackup configuration. [1] https://review.opendev.org/c/openstack/kolla-ansible/+/909912 Closes-bug: #2168443 Change-Id: I2d88af7c61bb609311a5f0a820a501d006f8e454 Signed-off-by: Seunghun Lee <seunghun@stackhpc.com> (cherry picked from commit 7c64ed9ff0509b4001d319f620d4bfe68ae9dfdb)
-rw-r--r--ansible/roles/mariadb/tasks/copy-certs.yml10
-rw-r--r--ansible/roles/mariadb/templates/backup.my.cnf.j23
-rw-r--r--ansible/roles/mariadb/templates/mariabackup.json.j27
3 files changed, 20 insertions, 0 deletions
diff --git a/ansible/roles/mariadb/tasks/copy-certs.yml b/ansible/roles/mariadb/tasks/copy-certs.yml
index 1c385e6d1..368df9302 100644
--- a/ansible/roles/mariadb/tasks/copy-certs.yml
+++ b/ansible/roles/mariadb/tasks/copy-certs.yml
@@ -1,4 +1,14 @@
---
+- name: "Copy CA certificates for mariabackup"
+ become: true
+ ansible.builtin.copy:
+ src: "{{ kolla_certificates_dir }}/ca/"
+ dest: "{{ node_config_directory }}/mariabackup/ca-certificates"
+ mode: "0644"
+ when:
+ - enable_mariabackup | bool
+ - inventory_hostname == mariadb_backup_host
+
- name: "Copy certificates and keys for {{ project_name }}"
ansible.builtin.import_role:
role: service-cert-copy
diff --git a/ansible/roles/mariadb/templates/backup.my.cnf.j2 b/ansible/roles/mariadb/templates/backup.my.cnf.j2
index 8d1ae2593..30065f4bd 100644
--- a/ansible/roles/mariadb/templates/backup.my.cnf.j2
+++ b/ansible/roles/mariadb/templates/backup.my.cnf.j2
@@ -4,3 +4,6 @@ user={{ mariadb_backup_database_user }}
password={{ mariadb_backup_database_password }}
host={{ api_interface_address }}
port={{ mariadb_port }}
+{% if database_enable_tls_backend | bool %}
+ssl_ca=/etc/mariadb/certs/root.crt
+{% endif %}
diff --git a/ansible/roles/mariadb/templates/mariabackup.json.j2 b/ansible/roles/mariadb/templates/mariabackup.json.j2
index ff32de2b6..7444364a6 100644
--- a/ansible/roles/mariadb/templates/mariabackup.json.j2
+++ b/ansible/roles/mariadb/templates/mariabackup.json.j2
@@ -7,6 +7,13 @@
"owner": "mysql",
"perm": "0600"
}
+ {% if database_enable_tls_backend | bool %},
+ {
+ "source": "{{ container_config_directory }}/ca-certificates/root.crt",
+ "dest": "/etc/mariadb/certs/root.crt",
+ "owner": "mysql",
+ "perm": "0600"
+ }{% endif %}
],
"permissions": [
{