ansible-mysql/defaults/main.yml

149 lines
4.5 KiB
YAML
Raw Normal View History

2015-07-12 15:42:46 +07:00
---
# -------------------------------------
# Setup
# -------------------------------------
mysql_origin: 'default'
2015-07-13 17:32:49 +07:00
mysql_vendor: 'mariadb'
2015-07-12 15:42:46 +07:00
mysql_root_password: 'change_me_NOW'
mysql_notify_restart: true
mysql_upstream_apt_src: false
2015-07-12 15:42:46 +07:00
# -------------------------------------
# Configuration
# -------------------------------------
2015-08-11 04:45:01 +07:00
# MySQL configuration template
mysql_config_template: 'etc/mysql/my.cnf.j2'
2015-08-11 04:45:01 +07:00
# MySQL connection settings.
mysql_port: "3306"
mysql_bind_address: '127.0.0.1'
mysql_datadir: '/var/lib/mysql'
mysql_pid_file: '/var/run/mysqld/mysqld.pid'
mysql_socket: '/var/run/mysqld/mysqld.sock'
# Slow query log settings.
mysql_slow_query_log_enabled: false
mysql_slow_query_log_file: '/var/log/mysql-slow.log'
mysql_slow_query_time: 2
# Memory settings (default values optimized ~512MB RAM).
mysql_key_buffer_size: '256M'
mysql_max_allowed_packet: '64M'
mysql_table_open_cache: '256'
mysql_sort_buffer_size: '1M'
mysql_read_buffer_size: '1M'
mysql_read_rnd_buffer_size: '4M'
mysql_myisam_sort_buffer_size: '64M'
mysql_thread_cache_size: '8'
mysql_query_cache_size: '16M'
# Other settings.
mysql_wait_timeout: 28800
# Try number of CPU's * 2 for thread_concurrency.
mysql_thread_concurrency: "{{ ansible_processor_cores * 2 }}"
2015-08-11 04:45:01 +07:00
# InnoDB settings.
mysql_innodb_file_per_table: '1'
mysql_innodb_buffer_pool_size: "{{ (ansible_memtotal_mb * 0.2) | round | int }}M"
mysql_innodb_log_file_size: "{% if ansible_distribution_release == 'jessie' and mysql_vendor == 'mysql' %}5M{% else %}64M{% endif %}" # 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
2015-08-11 04:45:01 +07:00
mysql_innodb_log_buffer_size: '8M'
mysql_innodb_flush_log_at_trx_commit: '1'
mysql_innodb_lock_wait_timeout: 50
# mysqldump settings.
mysql_mysqldump_max_allowed_packet: '64M'
# Logging settings.
mysql_log: ''
mysql_log_error: '/var/log/mysql.err'
mysql_syslog_tag: 'mysql'
# -------------------------------------
# Extra configuration
# -------------------------------------
#
2016-09-27 21:21:19 +07:00
mysql_extra_configuration: {}
2015-08-11 04:45:01 +07:00
# Example:
#mysql_extra_configuration:
2016-09-25 16:23:38 +07:00
# 'innodb_awsome_feature': 1
2015-07-12 15:42:46 +07:00
# -------------------------------------
# Replication
# -------------------------------------
mysql_replication_master: false
mysql_replication_slave: false
# This formula don't work with vagrant! All boxes have same default ip!
mysql_server_id: "{{ ansible_default_ipv4.address | ipaddr('int') }}"
mysql_replication_user: 'repl'
mysql_replication_password: 'change_me_NOW'
mysql_replication_host: '192.168.0.1'
mysql_replication_port: '3306'
mysql_backup_dir: '/var/backups/tmp-mysql'
# Master
mysql_max_binlog_size: "100M"
mysql_expire_logs_days: "10"
#
# Slave
#
mysql_slave_readonly: true
# Import data from
mysql_slave_import_data: true
# host used to create a backup (can be the master or another slave) - default: use the master
mysql_slave_import_from: "{{ mysql_replication_host }}"
# Delete dump after slave configuration (set false if you have many slaves to install, it avoids to create many dumps)
mysql_slave_import_flush_dump: true
# Slave uses mysql database from master?
mysql_slave_replicate_mysqldb: true
# Don't replicate these DBs/tables
mysql_slave_ignore_db: []
mysql_slave_ignore_table: []
# SSH user used to copy data
mysql_backup_user: "{{ ansible_user_id }}" # TODO: change var name
## If data is already imported, you can specify position
mysql_master_log_file: null
mysql_master_log_pos: null
# If true, reconfigure slave
mysql_slave_force_setup: false
2015-08-11 16:26:56 +07:00
# Only MariaDB 10.0+
mysql_gtid_domain_id: 1
2015-07-12 15:42:46 +07:00
# -------------------------------------
# Database / Users
# -------------------------------------
mysql_databases: []
mysql_users: []
# -------------------------------------
# MariaDB
# -------------------------------------
2017-06-01 20:33:09 +07:00
mysql_mariadb_version: '10.1'
2017-07-03 20:24:01 +07:00
mysql_mariadb_mirror_domain: "ftp.igh.cnrs.fr"
# See: https://downloads.mariadb.org/mariadb/repositories
2017-07-03 20:24:01 +07:00
mysql_mariadb_repository: "http://{{ mysql_mariadb_mirror_domain }}/pub/mariadb/repo/{{ mysql_mariadb_version }}/debian"
mysql_mariadb_key_server: "keyserver.ubuntu.com"
mysql_mariadb_key_ids: ['0xcbcb082a1bb943db', '0xf1656f24c74cd1d8']
2015-07-12 15:42:46 +07:00
# -------------------------------------
# Percona
# -------------------------------------
2017-06-01 20:33:09 +07:00
mysql_percona_version: '5.6'
mysql_percona_repository: 'http://repo.percona.com/apt'
mysql_use_percona_apt: false
mysql_install_xtrabackup_package: false
mysql_xtrabackup_package: "{{ mysql_default_xtrabackup_package }}"
# Galera
2016-10-03 17:16:56 +07:00
mysql_galera_resetup: false
2017-06-01 20:33:09 +07:00
mysql_galera_members: []
2016-09-25 19:28:10 +07:00
mysql_galera_primary_node: 'change_me' # See: https://github.com/ansible/ansible/issues/17453