Default variables

MariaDB server configuration


FQDN hostname of the MariaDB server. If a local MariaDB server is detected, it will override this variable automatically. Only one server at a time is currently supported per host.

mariadb_server: ''

Port number on which to connect to the server. You usually don’t need to change this.

mariadb_port: '3306'

Global client configuration


Variable which defines what database engine to use:

  • mariadb: default, use MariaDB engine from Debian repository
  • mariadb_upstream: use MariaDB engine from upstream repository
  • mysql: use MySQL engine from Debian repository
  • percona: use Percona XtraDB engine from upstream repository

The choice depends on availability of MariaDB packages in a distribution. Percona needs to be selected explicitly.

mariadb_flavor: '{{ (ansible_local.mariadb.flavor
                     if (ansible_local|d() and ansible_local.mariadb|d() and
                     else (mariadb_flavor_map[ansible_distribution_release] | default("mariadb"))) }}'

APT GPG key fingerprint used to sign the upstream MariaDB packages.

mariadb_upstream_key: '199369E5404BD5FC7D2FE43BCBCB082A1BB943DB'

Version of the MariaDB upstream.

mariadb_upstream_version: '10.1'

URL of the MariaDB upstream mirror.

mariadb_upstream_mirror: '{{ mariadb_upstream_version }}/{{ ansible_distribution | lower }}'

Address of the MariaDB upstream APT repository.

mariadb_upstream_repository: 'deb {{ mariadb_upstream_mirror }} {{ ansible_distribution_release }} main'

List of APT packages that should be installed with any database engine selected.

mariadb_base_packages: [ 'python-mysqldb' ]

List of additional packages to install with the database client.

mariadb_packages: []

Dictionary with list of packages that will be installed with a particular database engine.

  'mariadb': [ 'mariadb-client' ]
  'mariadb_upstream': [ 'mariadb-client' ]
  'mysql': [ 'mysql-client' ]
  'percona': [ 'percona-server-client' ]

When the database server is used remotely, this variable defines the “host” part of the client username. If a local MariaDB server is detected, this variable will be automatically changed to localhost.

mariadb_client: '{{ ansible_fqdn }}'

When the MariaDB server is used remotely, Ansible needs to run tasks on the correct host. This variable controls the task delegation to the correct database server.

If the MariaDB server is run locally, this should point to the FQDN hostname of the current host, NOT localhost because that would delegate the tasks to the Ansible Controller.

mariadb_delegate_to: '{{ mariadb_server
                         if (mariadb_server|d() and
                             mariadb_server != "localhost")
                         else ansible_fqdn }}'

Dict with additional MariaDB client options set system-wide, option names as keys and their values as values, added to /etc/mysql/conf.d/client.cnf. Options without specific values should be defined with empty values.

mariadb_client_options: {}

User account privileges


Should debops.mariadb automatically grant all privileges to a database named the same as the username for a given user account? This is equivalent to:

GRANT ALL PRIVILEGES ON `<user>`.* TO `<user>`@`<host>`;
mariadb_default_privileges: True

Should debops.mariadb automatically grant all privileges to databases with the same prefix as the username for a given user account? This is equivalent to:

GRANT ALL PRIVILEGES ON `<user>\_%`.* TO `<user>`@`<host>`;
mariadb_default_privileges_aux: True

Default privileges granted automatically. See Ansible mysql_user module for list and format of privileges.

mariadb_default_privileges_grant: 'ALL'

Databases, user accounts


Length of automatically generated user accounts, saved in the secret/ directory. See debops.secret role for more details about passwords.

mariadb_password_length: '48'

List of databases configured on the MariaDB server. See mariadb_databases for more details.

mariadb_databases: []

List of user accounts configured on the MariaDB server. See mariadb_users for more details.

mariadb_users: []