ansible-mysql/templates/etc/mysql/my.cnf.j2

82 lines
2.5 KiB
Plaintext
Raw Normal View History

2015-08-11 04:45:01 +07:00
#
# {{ ansible_managed }}
#
[client]
2018-03-17 23:28:54 +07:00
port = {{ mariadb_port }}
socket = {{ mariadb_socket }}
2015-08-11 04:45:01 +07:00
[mysqld]
2018-03-17 23:28:54 +07:00
port = {{ mariadb_port }}
bind-address = {{ mariadb_bind_address }}
datadir = {{ mariadb_datadir }}
socket = {{ mariadb_socket }}
2015-08-11 04:45:01 +07:00
2017-06-29 02:51:03 +07:00
{# TODO: FIX later #}
2015-08-11 04:45:01 +07:00
# Logging configuration.
2018-03-17 23:28:54 +07:00
{% if mariadb_log_error == 'syslog' %}
syslog
2018-03-17 23:28:54 +07:00
syslog-tag = {{ mariadb_syslog_tag }}
{% else %}
2018-03-17 23:28:54 +07:00
log-error = {{ mariadb_log_error }}
{% endif %}
2015-08-11 04:45:01 +07:00
2018-03-17 23:28:54 +07:00
{% if mariadb_slow_query_log_enabled %}
2015-08-11 04:45:01 +07:00
# Slow query log configuration.
slow_query_log = 1
2018-03-17 23:28:54 +07:00
slow_query_log_file = {{ mariadb_slow_query_log_file }}
long_query_time = {{ mariadb_slow_query_time }}
2015-08-11 04:45:01 +07:00
{% endif %}
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links = 0
# User is ignored when systemd is used (fedora >= 15).
user = mysql
# http://dev.mysql.com/doc/refman/5.5/en/performance-schema.html
;performance_schema
# Memory settings.
2018-03-17 23:28:54 +07:00
key_buffer_size = {{ mariadb_key_buffer_size }}
max_allowed_packet = {{ mariadb_max_allowed_packet }}
table_open_cache = {{ mariadb_table_open_cache }}
sort_buffer_size = {{ mariadb_sort_buffer_size }}
read_buffer_size = {{ mariadb_read_buffer_size }}
read_rnd_buffer_size = {{ mariadb_read_rnd_buffer_size }}
myisam_sort_buffer_size = {{ mariadb_myisam_sort_buffer_size }}
thread_cache_size = {{ mariadb_thread_cache_size }}
query_cache_size = {{ mariadb_query_cache_size }}
2015-08-11 04:45:01 +07:00
# Other settings.
2018-03-17 23:28:54 +07:00
wait_timeout = {{ mariadb_wait_timeout }}
2015-08-11 04:45:01 +07:00
# Try number of CPU's * 2 for thread_concurrency.
2018-03-17 23:28:54 +07:00
thread_concurrency = {{ mariadb_thread_concurrency }}
2015-08-11 04:45:01 +07:00
# InnoDB settings.
2018-03-17 23:28:54 +07:00
innodb_file_per_table = {{ mariadb_innodb_file_per_table }}
innodb_buffer_pool_size = {{ mariadb_innodb_buffer_pool_size }}
innodb_log_buffer_size = {{ mariadb_innodb_log_buffer_size }}
innodb_flush_log_at_trx_commit = {{ mariadb_innodb_flush_log_at_trx_commit }}
innodb_lock_wait_timeout = {{ mariadb_innodb_lock_wait_timeout }}
{# If this setting changes on a running system, you will break it! #}
{# See how tho change it here: http://dev.mysql.com/doc/refman/5.6/en/innodb-data-log-reconfiguration.html #}
{# TODO FIX -> Maybe detect a change and fail, just to be safe? #}
2018-03-17 23:28:54 +07:00
innodb_log_file_size = {{ mariadb_innodb_log_file_size }}
2015-08-11 04:45:01 +07:00
[mysqldump]
quick
2018-03-17 23:28:54 +07:00
max_allowed_packet = {{ mariadb_mysqldump_max_allowed_packet }}
2015-08-11 04:45:01 +07:00
[mysqld_safe]
2018-03-17 23:28:54 +07:00
pid-file = {{ mariadb_pid_file }}
2015-08-11 04:45:01 +07:00
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
# vim: set ft=dosini :