From b327ae4a56b3a7e3f929b3f884bc9501e712c60d Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Mon, 6 Mar 2023 23:45:23 +0100 Subject: [PATCH] mariadb: add mariadb_datadir_volume parameter With the parameter ``mariadb_datadir_volume`` it is possible to use a directory as volume for the mariadb service. By default, a volume named mariadb is used (the previous default). Change-Id: Ic61fe981825c5fa6f50e53c9555b6a102f42f522 --- ansible/group_vars/all.yml | 2 ++ ansible/roles/mariadb/defaults/main.yml | 2 +- .../notes/mariadb_datadir_volum-c9a597766c2c8bc8.yaml | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/mariadb_datadir_volum-c9a597766c2c8bc8.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 8ddb843396..01dc105818 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -392,6 +392,8 @@ mariadb_sst_port: "4444" mariadb_clustercheck_port: "4569" mariadb_monitor_user: "{{ 'monitor' if enable_proxysql | bool else 'haproxy' }}" +mariadb_datadir_volume: "mariadb" + mariadb_default_database_shard_id: 0 mariadb_default_database_shard_hosts: "{% set default_shard = [] %}{% for host in groups['mariadb'] %}{% if hostvars[host]['mariadb_shard_id'] is not defined or hostvars[host]['mariadb_shard_id'] == mariadb_default_database_shard_id %}{{ default_shard.append(host) }}{% endif %}{% endfor %}{{ default_shard }}" mariadb_shard_id: "{{ mariadb_default_database_shard_id }}" diff --git a/ansible/roles/mariadb/defaults/main.yml b/ansible/roles/mariadb/defaults/main.yml index 5e8c7d9a1b..eaa318963b 100644 --- a/ansible/roles/mariadb/defaults/main.yml +++ b/ansible/roles/mariadb/defaults/main.yml @@ -82,7 +82,7 @@ mariadb_default_volumes: - "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - - "mariadb:/var/lib/mysql" + - "{{ mariadb_datadir_volume }}:/var/lib/mysql" - "kolla_logs:/var/log/kolla/" mariadb_clustercheck_default_volumes: - "{{ node_config_directory }}/mariadb-clustercheck/:{{ container_config_directory }}/:ro" diff --git a/releasenotes/notes/mariadb_datadir_volum-c9a597766c2c8bc8.yaml b/releasenotes/notes/mariadb_datadir_volum-c9a597766c2c8bc8.yaml new file mode 100644 index 0000000000..f699f7ad45 --- /dev/null +++ b/releasenotes/notes/mariadb_datadir_volum-c9a597766c2c8bc8.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + With the parameter ``mariadb_datadir_volume`` it is possible + to use a directory as volume for the mariadb service. By default, + a volume named mariadb is used (the previous default).