mariadb: Aktiviere slowlog in der globalen Konfigurationsdatei

This commit is contained in:
phil 2022-06-09 13:38:00 +02:00
parent 415a6055e8
commit 10da0a723e
6 changed files with 21 additions and 23 deletions

View file

@ -2,6 +2,9 @@
- import_tasks: packages.yml
tags: packages
- import_tasks: mariadb.yml
tags: mariadb
- name: "Munin"
include_tasks: munin.yml
when: "'munin' in ansible_facts.packages"

6
tasks/mariadb.yml Normal file
View file

@ -0,0 +1,6 @@
---
- name: "mariadb | Kopiere Serverkonfiguration"
template:
src: 90-sao.cnf.j2
dest: /etc/mysql/mariadb.conf.d/90-sao.cnf
notify: restart mariadb

View file

@ -20,22 +20,3 @@
# Ausgabe von fehlerhaften Plugins (exit 1) ignorieren
ignore_errors: yes
notify: restart munin-node
- name: "Munin: Aktiviere slowlog"
lineinfile:
path: "{{ mysql_server_config_file }}"
insertafter: ^# Enable the slow query
line: 'slow_query_log = 1'
notify: restart mysql
- name: "Munin: Konfiguriere slowlog"
lineinfile:
path: "{{ mysql_server_config_file }}"
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^#slow_query_log_file', line: 'slow_query_log_file = /var/log/mysql/mariadb-slow.log' }
- { regexp: '^#long_query_time', line: 'long_query_time = 10' }
- { regexp: '^#log_slow_rate_limit', line: 'log_slow_rate_limit = 1000' }
- { regexp: '^#log_slow_verbosity', line: 'log_slow_verbosity = query_plan' }
notify: restart mysql