forked from fauust/ansible-role-mariadb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mariadb.cnf.j2
59 lines (52 loc) · 1.43 KB
/
mariadb.cnf.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# {{ ansible_managed }}
[mariadb]
# Basic settings
{{ mariadb_basic_settings_raw }}
# Fine tuning
{{ mariadb_fine_tuning_raw }}
# Logging
{% if mariadb_replication_role != '' %}
# warning log-basename is defined later for replication
# some log option may be ignored.
# see: https://mariadb.com/kb/en/mysqld-options/#-log-basename
{% endif %}
{{ mariadb_logging_raw }}
# Query cache
{{ mariadb_query_cache_raw }}
# Character sets
{{ mariadb_character_sets_raw }}
# InnoDB
{{ mariadb_innodb_raw }}
{% if mariadb_replication_role != '' %}
# Replication
server-id = {{ mariadb_server_id }}
log-basename = mariadb
{% if mariadb_replication_role == 'primary' %}
log_bin
expire_logs_days = {{ mariadb_expire_logs_days }}
max_binlog_size = {{ mariadb_max_binlog_size }}
binlog_format = {{mariadb_binlog_format}}
# the following permits to simplify the process of moving a replica to a
# primary node role by ensuring that replication is not started on primary node
skip-slave-start
{% for db in mariadb_databases %}
{% if db.replicate|default(false) %}
binlog_do_db = {{ db.name }}
{% else %}
binlog_ignore_db = {{ db.name }}
{% endif %}
{% endfor %}
{% endif %}
{% if mariadb_replication_role == 'replica' %}
read_only
relay-log = relay-bin
relay-log-index = relay-bin.index
{% for db in mariadb_databases %}
{% if db.replicate|default(false) %}
replicate_do_db = {{ db.name }}
{% endif %}
{% endfor %}
{% endif %}
{% endif -%}
[mysqldump]
{{ mariadb_mysqldump_raw }}