Upgrading mariadb recreate my.cnf symlink

Upgrading mariadb will recreate my.cnf symlink so it's better to use
mariadb.cnf as the default configuration file.

+ add skip-name-resolve option by default
+ logging option was ignored

squash

s
This commit is contained in:
Faustin Lammler 2021-06-25 09:42:06 +02:00
parent 32bbfa09fa
commit e19b7b0365
No known key found for this signature in database
GPG Key ID: 390A2F27832A5C79
6 changed files with 8 additions and 7 deletions

View File

@ -63,16 +63,16 @@ production systems to prevent ansible runs from restarting the MariaDB Server.
To populate the MariaDB Server configuration file, we use almost only raw
variables. This permits more flexibility and a very simple
[`templates/my.cnf.j2`](./templates/my.cnf.j2) file.
[`templates/mariadb.cnf.j2`](./templates/mariadb.cnf.j2) file.
By default, some common and standard options are deployed based on the MariaDB
Foundation package and it should be easy to change them all (see
[`my.cnf`](./my.cnf)).
[`mariadb.cnf`](./mariadb.cnf)).
#### Basic settings
```yaml
mariadb_config_file: /etc/mysql/my.cnf
mariadb_config_file: /etc/mysql/mariadb.cnf
mariadb_datadir: /var/lib/mysql
mariadb_port: 3306
mariadb_bind_address: 127.0.0.1

View File

@ -14,7 +14,7 @@ mariadb_can_restart: true
mariadb_overwrite_global_config_file: true
# MariaDB configuration file
mariadb_config_file: /etc/mysql/my.cnf
mariadb_config_file: /etc/mysql/mariadb.cnf
# Basic settings
mariadb_datadir: /var/lib/mysql
mariadb_port: 3306
@ -44,6 +44,7 @@ mariadb_fine_tuning_raw: |
bulk_insert_buffer_size = 16M
tmp_table_size = 32M
max_heap_table_size = 32M
skip-name-resolve = 1
# Query cache
mariadb_query_cache_raw: |

View File

View File

@ -29,7 +29,7 @@ def test_mariadb_enabled_and_running(host):
def test_ensure_custom_config_is_applied(host):
config = host.file("/etc/mysql/my.cnf")
config = host.file("/etc/mysql/mariadb.cnf")
assert config.contains("datadir")
assert config.user == "root"
assert config.group == "root"

View File

@ -1,7 +1,7 @@
---
- name: Copy global MariaDB configuration
template:
src: my.cnf.j2
src: mariadb.cnf.j2
dest: "{{ mariadb_config_file }}"
owner: root
group: root

View File

@ -11,8 +11,8 @@
# warning log-basename is defined later for replication
# some log option may be ignored.
# see: https://mariadb.com/kb/en/mysqld-options/#-log-basename
{{ mariadb_logging_raw }}
{% endif %}
{{ mariadb_logging_raw }}
# Query cache
{{ mariadb_query_cache_raw }}
# Character sets