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 To populate the MariaDB Server configuration file, we use almost only raw
variables. This permits more flexibility and a very simple 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 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 Foundation package and it should be easy to change them all (see
[`my.cnf`](./my.cnf)). [`mariadb.cnf`](./mariadb.cnf)).
#### Basic settings #### Basic settings
```yaml ```yaml
mariadb_config_file: /etc/mysql/my.cnf mariadb_config_file: /etc/mysql/mariadb.cnf
mariadb_datadir: /var/lib/mysql mariadb_datadir: /var/lib/mysql
mariadb_port: 3306 mariadb_port: 3306
mariadb_bind_address: 127.0.0.1 mariadb_bind_address: 127.0.0.1

View File

@ -14,7 +14,7 @@ mariadb_can_restart: true
mariadb_overwrite_global_config_file: true mariadb_overwrite_global_config_file: true
# MariaDB configuration file # MariaDB configuration file
mariadb_config_file: /etc/mysql/my.cnf mariadb_config_file: /etc/mysql/mariadb.cnf
# Basic settings # Basic settings
mariadb_datadir: /var/lib/mysql mariadb_datadir: /var/lib/mysql
mariadb_port: 3306 mariadb_port: 3306
@ -44,6 +44,7 @@ mariadb_fine_tuning_raw: |
bulk_insert_buffer_size = 16M bulk_insert_buffer_size = 16M
tmp_table_size = 32M tmp_table_size = 32M
max_heap_table_size = 32M max_heap_table_size = 32M
skip-name-resolve = 1
# Query cache # Query cache
mariadb_query_cache_raw: | 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): 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.contains("datadir")
assert config.user == "root" assert config.user == "root"
assert config.group == "root" assert config.group == "root"

View File

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

View File

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