From c68dbc98ca346a098ca2cdfb2f8dc49001e38697 Mon Sep 17 00:00:00 2001 From: Joshua Hoffmann Date: Thu, 24 Oct 2024 12:02:46 +0200 Subject: [PATCH] make log_error configurable --- defaults/main.yml | 1 + templates/etc/mysql/my.cnf.j2 | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index d5ade5e..8903529 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -41,6 +41,7 @@ mariadb_mysql_settings: datadir: "/var/lib/mysql" #Default is 16M key_buffer_size: "{{ (ansible_memtotal_mb | int * mariadb_mysql_mem_multiplier) | round | int }}M" + log_error: /var/log/mysql/error.log max_allowed_packet: "16M" max_binlog_size: "100M" query_cache_limit: "1M" diff --git a/templates/etc/mysql/my.cnf.j2 b/templates/etc/mysql/my.cnf.j2 index 1504948..3083ba3 100644 --- a/templates/etc/mysql/my.cnf.j2 +++ b/templates/etc/mysql/my.cnf.j2 @@ -13,7 +13,9 @@ basedir = /usr datadir = {{ mariadb_mysql_settings['datadir'] }} key_buffer_size = {{ mariadb_mysql_settings['key_buffer_size'] }} lc-messages-dir = /usr/share/mysql -log_error = /var/log/mysql/error.log +{% if mariadb_mysql_settings['log_error'] is defined -%} +log_error = {{ mariadb_mysql_settings['log_error'] }} +{%+ endif %} max_allowed_packet = {{ mariadb_mysql_settings['max_allowed_packet'] }} max_binlog_size = {{ mariadb_mysql_settings['max_binlog_size'] }} myisam-recover = BACKUP