You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Installs and configures MariaDB on Debian/Ubuntu and FreeBSD based systems.
Supports single-node deployments as well as Galera clusters (including garbd arbitrator nodes).
Handles database creation, user management and optional automated backups.
Options for mariadb
Option
Description
Type
Required
Default
version
MariaDB major.minor version to install. Used to build repository URLs and to pick compatible packages.
str
no
11.8
prefix
Base directories for MariaDB configuration files.
dict of 'prefix' options
no
{}
socket
Path to the MariaDB UNIX socket used by mysql CLI modules and health checks.
str
no
{% if ansible_facts['system'] == 'Linux' %}/run/mysqld/mysqld.sock{% else %}/tmp/mysql.sock{% endif %}
service
Systemd/rc service name that is controlled by the role.
str
no
{% if ansible_facts['system'] == 'Linux' %}mysql{% else %}mysql-server{% endif %}
repository
Optional vendor repository configuration (currently only APT is supported).
dict of 'repository' options
no
my.cnf
Declarative representation of the contents that should end up in zz-ansible.cnf. Keys correspond to section names (mysqld, mysqld_safe, galera, ...); nested keys represent option/value pairs. Values set to null remove the option from the rendered file.
dict
no
database_defaults
Fallback charset/collation used when a database entry omits explicit values.
Declarative list of databases to create; keys are arbitrary identifiers. Each entry must set name and can optionally define encoding, collation, import_file, or a nested backup dict with the same shape as mariadb.backup for per-database overrides. When import_file is present, the local file is uploaded and restored immediately after creation.
dict
no
users
Database users and grants to configure; keys are arbitrary user identifiers. Each entry expects password, a hosts mapping (values can be strings or lists) and a privileges dict whose values follow the <db>.<table>:priv1,priv2 syntax consumed by community.mysql.mysql_user. The role will iterate over every host in hosts and apply the merged privilege strings.
dict
no
galera
Settings that control Galera behaviour.
dict of 'galera' options
no
{}
backup
Controls whether automated dumps are made and when they run.
dict of 'backup' options
no
{}
Options for mariadb.prefix
Option
Description
Type
Required
Default
config
Parent directory that will contain conf.d/mariadb.conf.d. Change this only when using custom filesystem layouts.
str
no
{% if ansible_facts['system'] == 'Linux' %}/etc/mysql{% else %}/usr/local/etc/mysql{% endif %}
lib
Data directory used by MariaDB (e.g. for grastate.dat on Galera nodes). Linux uses /var/lib/mysql; FreeBSD uses /var/db/mysql.
str
no
{% if ansible_facts['system'] == 'Linux' %}/var/lib/mysql{% else %}/var/db/mysql{% endif %}
Options for mariadb.repository
Option
Description
Type
Required
Default
apt
Repository definition that will be managed on Debian/Ubuntu hosts.
dict of 'apt' options
no
{}
Options for mariadb.repository.apt
Option
Description
Type
Required
Default
key_url
URL of the GPG key used to sign the MariaDB packages.