ansible-mysql/defaults/main.yml

137 lines
4.1 KiB
YAML
Raw Normal View History

2015-07-12 15:42:46 +07:00
---
# -------------------------------------
# Setup
# -------------------------------------
2018-03-17 23:28:54 +07:00
mariadb_origin: 'default'
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'
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).
# Fine Tuning
2018-03-17 23:28:54 +07:00
mariadb_key_buffer_size: '256M'
mariadb_max_allowed_packet: '64M'
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'
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"
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
# 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:
# mariadb_extra_configuration:
# 'innodb_awsome_feature': 1
# -------------------------------------
# Replication
# -------------------------------------
2018-03-17 23:28:54 +07:00
mariadb_replication_master: false
mariadb_replication_slave: false
# 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') }}"
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'
2018-03-17 23:28:54 +07:00
mariadb_backup_dir: '/var/backups/tmp-mysql'
mariadb_service_name: '{{ mariadb_default_service_name if mariadb_origin == "default" else "mariadb" }}'
# Master
2018-03-17 23:28:54 +07:00
mariadb_max_binlog_size: "100M"
mariadb_expire_logs_days: "10"
#
# Slave
#
2018-03-17 23:28:54 +07:00
mariadb_slave_readonly: true
# Import data from
2018-03-17 23:28:54 +07:00
mariadb_slave_import_data: true
# 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 }}"
# 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
# Don't replicate these DBs/tables
2018-03-17 23:28:54 +07:00
mariadb_slave_ignore_db: []
mariadb_slave_ignore_table: []
# SSH user used to copy data
mariadb_backup_user: "{{ ansible_user_id }}" # TODO: change var name
## 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
# If true, reconfigure slave
2018-03-17 23:28:54 +07:00
mariadb_slave_force_setup: false
mariadb_gtid_domain_id: 1
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
# -------------------------------------
# MariaDB Upstream
2015-07-12 15:42:46 +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
# -------------------------------------
# Galera
# -------------------------------------
2018-03-17 23:28:54 +07:00
mariadb_galera_resetup: false
mariadb_wsrep_node_address: false # Set primary node IP
2018-03-17 23:28:54 +07:00
mariadb_galera_members: []
mariadb_galera_primary_node: 'change_me' # See: https://github.com/ansible/ansible/issues/17453
mariadb_wsrep_stt_method: 'rsync'
mariadb_galera_package_name: 'galera-4'
# -------------------------------------
# Debug
# -------------------------------------
mariadb_debug_role: false