Ansible
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

mariadb

Source Code Build Status GitHub

Role to setup MariaDB server.


Default Variables

mariadb_apt_cache_update

Automatically update apt cache on package installations. This setting will only applied on apt-based operating systems e.g. Ubuntu.

Default value

mariadb_apt_cache_update: false

mariadb_bind_address

Default value

mariadb_bind_address: 127.0.0.0

mariadb_config_file

Example usage

mariadb_config_file: /etc/mysql/mariadb.cnf

mariadb_config_include_dir

Include dir for custom MariaDB config files. The default value depends on the operatig system.

Example usage

mariadb_config_include_dir: /etc/mysql/conf.d

mariadb_config_include_files

Default value

mariadb_config_include_files: []

Example usage

mariadb_config_include_files:
  - src: path/relative/to/playbook/file.cnf
  - src: path/relative/to/playbook/anotherfile.cnf
    force: yes

mariadb_databases

Default value

mariadb_databases:
  - name: owncloud
    collation: utf8mb4_bin
    encoding: utf8mb4

mariadb_datadir

MariaDB data directory to use. Default value depends on your operating system.

Example usage

mariadb_datadir: /var/lib/mysql

mariadb_enabled_on_startup

Default value

mariadb_enabled_on_startup: true

mariadb_environment_isolation

On RedHat/CentOS 7 based systems, Software Collections are used to install a more up-to-date version of MariaDB. By default, Software Collection packages will be installed completely isolated from the default system package environment to avoid conflicts. In order to use the Software Collections packages, users need to do “few things” differently than with normal RPMs. For example, they need to use ‘scl enable’ call, which changes environment variables like PATH or LD_LIBRARY_PATH, so that binaries under alternative path are found. Users also need to use different names for systemd services. Or, some scripts might use full paths for the binaries, like /usr/bin/mysql.

If only one MariaDB version is installed on this system, the isolation can be disabled. mariadb_environment_isolation allow users to choose, whether they prefer isolation or usage simplicity.

On systems not based on RedHat/CentOS 7 this option has no effect and will be ignored.

mariadb_event_scheduler_state

Default value

mariadb_event_scheduler_state: OFF

mariadb_group_concat_max_len

Default value

mariadb_group_concat_max_len: '1024'

mariadb_innodb_buffer_pool_size

Default value

mariadb_innodb_buffer_pool_size: 256M

mariadb_innodb_file_format

Default value

mariadb_innodb_file_format: _unset_

mariadb_innodb_file_per_table

Default value

mariadb_innodb_file_per_table: ON

mariadb_innodb_flush_log_at_trx_commit

Default value

mariadb_innodb_flush_log_at_trx_commit: '1'

mariadb_innodb_flush_method

Default value

mariadb_innodb_flush_method: O_DIRECT

mariadb_innodb_io_capacity

Default value

mariadb_innodb_io_capacity: 200

mariadb_innodb_large_prefix

Default value

mariadb_innodb_large_prefix: _unset_

mariadb_innodb_lock_wait_timeout

Default value

mariadb_innodb_lock_wait_timeout: '50'

mariadb_innodb_log_buffer_size

Default value

mariadb_innodb_log_buffer_size: 8M

mariadb_innodb_log_file_size

Default value

mariadb_innodb_log_file_size: 128M

mariadb_innodb_read_io_threads

Default value

mariadb_innodb_read_io_threads: 4

mariadb_innodb_write_io_threads

Default value

mariadb_innodb_write_io_threads: '{{ mariadb_innodb_read_io_threads }}'

mariadb_join_buffer_size

Default value

mariadb_join_buffer_size: '262144'

mariadb_key_buffer_size

Default value

mariadb_key_buffer_size: 256M

mariadb_log_error

Default value depends on your operating system.

Example usage

mariadb_log_error: /var/log/mysql/error.log

mariadb_log_file_group

Default value depends on your operating system.

Example usage

mariadb_log_file_group: adm

mariadb_lower_case_table_names

Default value

mariadb_lower_case_table_names: '0'

mariadb_max_allowed_packet

Default value

mariadb_max_allowed_packet: 64M

mariadb_max_connections

Default value

mariadb_max_connections: '151'

mariadb_max_heap_table_size

Default value

mariadb_max_heap_table_size: 16M

mariadb_myisam_sort_buffer_size

Default value

mariadb_myisam_sort_buffer_size: 64M

mariadb_mysqldump_max_allowed_packet

Default value

mariadb_mysqldump_max_allowed_packet: 64M

mariadb_overwrite_global_mycnf

Whether my.cnf should be updated on every run.

Default value

mariadb_overwrite_global_mycnf: true

mariadb_packages

Define a custom list of packages to install. Default value depends on your operating system.

Example usage

mariadb_packages:
  - mariadb
  - mariadb-server
  - MySQL-python

mariadb_packages_extra

List of extra packages to install e.g. a set of custom dependencies.

Default value

mariadb_packages_extra: []

mariadb_pid_file

Path to MariaDB PID file. Default value depends on your operating system.

Example usage

mariadb_pid_file: /var/run/mysqld/mysqld.pid

mariadb_port

Default value

mariadb_port: '3306'

mariadb_query_cache_limit

Default value

mariadb_query_cache_limit: 1M

mariadb_query_cache_size

Default value

mariadb_query_cache_size: 16M

mariadb_query_cache_type

Default value

mariadb_query_cache_type: '0'

mariadb_read_buffer_size

Default value

mariadb_read_buffer_size: 1M

mariadb_read_rnd_buffer_size

Default value

mariadb_read_rnd_buffer_size: 4M

mariadb_root_password

Password for the default MariaDB root user. For security reasons you should change it to some secure in production use!

Default value

mariadb_root_password: root

mariadb_server_id

The server_id uniquely identifies the server instance in the community of replication partners, see documentation.

Default value

mariadb_server_id: _unset_

mariadb_skip_name_resolve

Default value

mariadb_skip_name_resolve: false

mariadb_socket

Path to MariaDB unix socket. Default value depends on your operating system.

Example usage

mariadb_socket: /var/run/mysqld/mysqld.sock

mariadb_sort_buffer_size

Default value

mariadb_sort_buffer_size: 1M

mariadb_sql_mode

MariaDB supports several different modes. You can pass a list of options to to suit your needs.

Default value

mariadb_sql_mode: []

mariadb_sync_binlog

Default value

mariadb_sync_binlog: 1

mariadb_table_open_cache

Default value

mariadb_table_open_cache: '256'

mariadb_thread_cache_size

Default value

mariadb_thread_cache_size: '8'

mariadb_tmp_table_size

Default value

mariadb_tmp_table_size: 16M

mariadb_transaction_isolation_level

Set transaction isolation level. Possible values: READ-UNCOMMITTED|READ-COMMITTED|REPEATABLE-READ|SERIALIZABLE

Default value

mariadb_transaction_isolation_level: READ-COMMITTED

mariadb_users

Default value

mariadb_users:
  - name: owncloud
    host: localhost
    password: owncloud
    priv: owncloud.*:ALL

mariadb_wait_timeout

Default value

mariadb_wait_timeout: '28800'

Dependencies

None.