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).