2015-07-12 15:42:46 +07:00
---
# -------------------------------------
# Setup
# -------------------------------------
2018-03-17 23:28:54 +07:00
mariadb_origin : 'default'
2019-04-16 18:55:38 +07:00
mariadb_use_galera : false
2018-03-17 23:28:54 +07:00
mariadb_notify_restart : true
2015-07-12 15:42:46 +07:00
# -------------------------------------
# Configuration
# -------------------------------------
2015-08-11 04:45:01 +07:00
2018-03-18 00:47:35 +07:00
# MariaDB connection settings.
2018-03-17 23:28:54 +07:00
mariadb_port : "3306"
mariadb_bind_address : '127.0.0.1'
mariadb_datadir : '/var/lib/mysql'
2019-12-29 01:02:41 +07:00
mariadb_pid_file : '/run/mysqld/mysqld.pid'
mariadb_socket : '/run/mysqld/mysqld.sock'
2015-08-11 04:45:01 +07:00
# Slow query log settings.
2018-03-17 23:28:54 +07:00
mariadb_slow_query_log_enabled : false
mariadb_slow_query_log_file : '/var/log/mysql/mysql_slow.log'
mariadb_slow_query_time : 2
2015-08-11 04:45:01 +07:00
# Memory settings (default values optimized ~512MB RAM).
2019-12-29 01:02:41 +07:00
# Fine Tuning
2018-03-17 23:28:54 +07:00
mariadb_key_buffer_size : '256M'
mariadb_max_allowed_packet : '64M'
2019-12-29 01:02:41 +07:00
mariadb_max_connections : 100
mariadb_table_open_cache : '2000'
mariadb_sort_buffer_size : '2M'
2018-03-17 23:28:54 +07:00
mariadb_read_buffer_size : '1M'
2019-12-29 01:02:41 +07:00
mariadb_read_rnd_buffer_size : '2M'
mariadb_myisam_sort_buffer_size : '128M'
mariadb_thread_cache_size : '256'
2018-03-17 23:28:54 +07:00
mariadb_query_cache_size : '16M'
2015-08-11 04:45:01 +07:00
# Other settings.
2018-03-17 23:28:54 +07:00
mariadb_wait_timeout : 28800
2015-08-11 04:45:01 +07:00
# InnoDB settings.
2018-03-17 23:28:54 +07:00
mariadb_innodb_buffer_pool_size : "{{ (ansible_memtotal_mb * 0.2) | round | int }}M"
2021-09-02 23:17:54 +07:00
mariadb_innodb_log_file_size : "64M" # If this setting changes on a running system, you will break it! http://dev.mysql.com/doc/refman/5.6/en/innodb-data-log-reconfiguration.html
2018-03-17 23:28:54 +07:00
mariadb_innodb_log_buffer_size : '8M'
mariadb_innodb_flush_log_at_trx_commit : '1'
mariadb_innodb_lock_wait_timeout : 50
2015-08-11 04:45:01 +07:00
# Logging settings.
2018-03-17 23:28:54 +07:00
mariadb_log_error : '/var/log/mysql/mysql_error.log'
mariadb_syslog_tag : 'mysql'
2015-08-11 04:45:01 +07:00
2019-12-29 01:02:41 +07:00
# mysqldump settings.
mariadb_mysqldump_max_allowed_packet : '64M'
2015-08-11 04:45:01 +07:00
# -------------------------------------
# Extra configuration
# -------------------------------------
#
2018-03-17 23:28:54 +07:00
mariadb_extra_configuration : {}
2015-08-11 04:45:01 +07:00
# Example:
2021-09-02 23:17:54 +07:00
# mariadb_extra_configuration:
# 'innodb_awsome_feature': 1
2015-08-11 15:22:58 +07:00
# -------------------------------------
# Replication
# -------------------------------------
2018-03-17 23:28:54 +07:00
mariadb_replication_master : false
mariadb_replication_slave : false
2015-08-11 15:22:58 +07:00
# This formula don't work with vagrant! All boxes have same default ip!
2018-03-17 23:28:54 +07:00
mariadb_server_id : "{{ ansible_default_ipv4.address | ipaddr('int') }}"
2015-08-11 15:22:58 +07:00
2018-03-17 23:28:54 +07:00
mariadb_replication_user : 'repl'
mariadb_replication_password : 'change_me_NOW'
mariadb_replication_host : '192.168.0.1'
mariadb_replication_port : '3306'
2015-08-11 15:22:58 +07:00
2018-03-17 23:28:54 +07:00
mariadb_backup_dir : '/var/backups/tmp-mysql'
2015-08-11 15:22:58 +07:00
2021-09-02 23:17:54 +07:00
mariadb_service_name : '{{ mariadb_default_service_name if mariadb_origin == "default" else "mariadb" }}'
2015-08-11 15:22:58 +07:00
# Master
2018-03-17 23:28:54 +07:00
mariadb_max_binlog_size : "100M"
mariadb_expire_logs_days : "10"
2015-08-11 15:22:58 +07:00
#
# Slave
#
2018-03-17 23:28:54 +07:00
mariadb_slave_readonly : true
2015-08-11 15:22:58 +07:00
# Import data from
2018-03-17 23:28:54 +07:00
mariadb_slave_import_data : true
2015-08-11 15:22:58 +07:00
# host used to create a backup (can be the master or another slave) - default: use the master
2018-03-17 23:28:54 +07:00
mariadb_slave_import_from : "{{ mariadb_replication_host }}"
2015-08-11 15:22:58 +07:00
# Delete dump after slave configuration (set false if you have many slaves to install, it avoids to create many dumps)
2018-03-17 23:28:54 +07:00
mariadb_slave_import_flush_dump : true
2015-08-11 15:22:58 +07:00
# Don't replicate these DBs/tables
2018-03-17 23:28:54 +07:00
mariadb_slave_ignore_db : [ ]
mariadb_slave_ignore_table : [ ]
2015-08-11 15:22:58 +07:00
# SSH user used to copy data
2021-09-02 23:17:54 +07:00
mariadb_backup_user : "{{ ansible_user_id }}" # TODO: change var name
2015-08-11 15:22:58 +07:00
## If data is already imported, you can specify position
2018-03-17 23:28:54 +07:00
mariadb_master_log_file : null
mariadb_master_log_pos : null
2015-08-11 15:22:58 +07:00
# If true, reconfigure slave
2018-03-17 23:28:54 +07:00
mariadb_slave_force_setup : false
mariadb_gtid_domain_id : 1
2015-08-11 15:22:58 +07:00
2015-07-12 15:42:46 +07:00
# -------------------------------------
# Database / Users
# -------------------------------------
2018-03-17 23:28:54 +07:00
mariadb_databases : [ ]
mariadb_users : [ ]
2015-07-12 15:42:46 +07:00
# -------------------------------------
2022-02-28 16:11:30 +07:00
# MariaDB Upstream
2015-07-12 15:42:46 +07:00
# -------------------------------------
2022-02-28 16:11:30 +07:00
mariadb_upstream_setup_script : 'https://r.mariadb.com/downloads/mariadb_repo_setup'
mariadb_upstream_version : '10.6'
2015-07-12 15:42:46 +07:00
# -------------------------------------
2018-03-17 23:05:45 +07:00
# Galera
# -------------------------------------
2018-03-17 23:28:54 +07:00
mariadb_galera_resetup : false
2021-09-02 23:17:54 +07:00
mariadb_wsrep_node_address : false # Set primary node IP
2018-03-17 23:28:54 +07:00
mariadb_galera_members : [ ]
2021-09-02 23:17:54 +07:00
mariadb_galera_primary_node: 'change_me' # See : https://github.com/ansible/ansible/issues/17453
2018-07-14 16:33:43 +07:00
mariadb_wsrep_stt_method : 'rsync'
2021-09-01 17:24:40 +07:00
2021-09-02 23:17:54 +07:00
mariadb_galera_package_name : 'galera-4'
2021-09-01 17:24:40 +07:00
# -------------------------------------
# Debug
# -------------------------------------
mariadb_debug_role : false