Configure MariDB server via this role

This commit is contained in:
phil 2023-10-14 10:43:06 +02:00
parent 1f1c8d1542
commit 6b3d265524
6 changed files with 32 additions and 28 deletions

View file

@ -1,11 +1,11 @@
# Managed by ansible
# {{ ansible_managed }}
DBHOST={{ automysqlbackiup_dbhost | default("localhost") }}
DBHOST={{ automysqlbackiup_dbhost }}
DBNAMES=`mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW DATABASES" | awk '{print $1}' | grep -v ^Database$ | grep -v ^mysql$ | grep -v ^performance_schema$ | grep -v ^information_schema$ | tr \\\r\\\n ,\ `
BACKUPDIR="{{ automysqlbackup_backupdir | default("/var/lib/automysqlbackup") }}"
BACKUPDIR="{{ automysqlbackup_backupdir }}"
MAILCONTENT="quiet"
MAXATTSIZE="4000"
MAILADDR="{{ automysqlbackup_mailaddr | default("root") }}"
MAILADDR="{{ automysqlbackup_mailaddr }}"
MDBNAMES="mysql $DBNAMES"
DBEXCLUDE=""
CREATE_DATABASE=yes

View file

@ -1,9 +1,9 @@
# Ansible managed
# {{ ansible_managed }}
[mysqld]
# slow log
slow_query_log = 1
slow_query_log_file = {{ slowlog_query_log_file }}
long_query_time = {{ slowlog_query_time }}
log_slow_rate_limit = {{ slowlog_log_slow_rate_limit }}
log_slow_verbosity = query_plan
{% if mysqld_config is defined %}
{% for key, value in mysqld_config.items() %}
{{ key }} = {{ value }}
{% endfor %}
{% endif %}

View file

@ -1,3 +1,5 @@
# {{ ansible_managed }}
check process mariadb with pidfile /run/mysqld/mysqld.pid
group database
start program = "/usr/sbin/service mysql start"

View file

@ -1,4 +1,6 @@
# {{ ansible_managed }}
[mysql*]
env.mysqluser {{ munin_sql_user }}
env.mysqlpassword {{ munin_sql_password }}
env.mysqlconnection DBI:mysql:information_schema
env.mysqlconnection DBI:mysql:information_schema