Enable configuration of Systemd service

This commit is contained in:
phil 2024-01-21 01:13:24 +01:00
parent 0eb0f907dc
commit 34a7951539
4 changed files with 24 additions and 11 deletions

View file

@ -16,6 +16,16 @@ mysqld:
...
```
## Changes to the Systemd service
Use the following options to configure your MariaDB service:
```YAML
mariadb_service
limitnofile: 64184
restart: on-failure
```
## Backup
For daily backups we use automysqlbackup. You can configure it via the dict

View file

@ -1,8 +0,0 @@
# Ansible manages
[Unti]
StartLimitIntervalSec=6
StartLimitBurst=10
[Service]
Restart=always

View file

@ -7,9 +7,9 @@
notify: restart mariadb
- name: "Configuration | Copy systemd override"
ansible.builtin.copy:
src: systemd/override.conf
dest: /etc/systemd/systemd/mariadb.service.d/
ansible.builtin.template:
src: systemd/override.conf.j2
dest: /etc/systemd/systemd/mariadb.service.d/override.conf
mode: "0644"
notify:
- Reload systemd

View file

@ -0,0 +1,11 @@
{{ ansible_managed | comment }}
[Unti]
StartLimitIntervalSec=6
StartLimitBurst=10
[Service]
Restart={{ mariadb_service.restart | default('always') }}
{% if mariadb_service.limitnofile is defined %}
LimitNOFILE={{ mariadb_service.limitnofile }}
{% endif %}