Default variables

MariaDB server configuration

mariadb_server

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: ''
mariadb_port

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

mariadb_port: '3306'

Global client configuration

mariadb_flavor

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
                         ansible_local.mariadb.flavor|d())
                     else (mariadb_flavor_map[ansible_distribution_release] | default("mariadb"))) }}'
mariadb_upstream_key

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

mariadb_upstream_key: '199369E5404BD5FC7D2FE43BCBCB082A1BB943DB'
mariadb_upstream_version

Version of the MariaDB upstream.

mariadb_upstream_version: '10.1'
mariadb_upstream_mirror

URL of the MariaDB upstream mirror.

mariadb_upstream_mirror: 'http://nyc2.mirrors.digitalocean.com/mariadb/repo/{{ mariadb_upstream_version }}/{{ ansible_distribution | lower }}'
mariadb_upstream_repository

Address of the MariaDB upstream APT repository.

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

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

mariadb_base_packages: [ 'python-mysqldb' ]
mariadb_packages

List of additional packages to install with the database client.

mariadb_packages: []
mariadb_packages_map

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

mariadb_packages_map:
  'mariadb': [ 'mariadb-client' ]
  'mariadb_upstream': [ 'mariadb-client' ]
  'mysql': [ 'mysql-client' ]
  'percona': [ 'percona-server-client' ]
mariadb_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 }}'
mariadb_delegate_to

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 }}'
mariadb_client_options

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

mariadb_default_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
mariadb_default_privileges_aux

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
mariadb_default_privileges_grant

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

mariadb_default_privileges_grant: 'ALL'

Databases, user accounts

mariadb_password_length

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

mariadb_password_length: '48'
mariadb_databases

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

mariadb_databases: []
mariadb_users

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

mariadb_users: []