Enable configuration of Systemd service
This commit is contained in:
parent
0eb0f907dc
commit
34a7951539
4 changed files with 24 additions and 11 deletions
10
README.md
10
README.md
|
@ -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
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
# Ansible manages
|
||||
|
||||
[Unti]
|
||||
StartLimitIntervalSec=6
|
||||
StartLimitBurst=10
|
||||
|
||||
[Service]
|
||||
Restart=always
|
|
@ -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
|
||||
|
|
11
templates/systemd/override.conf.j2
Normal file
11
templates/systemd/override.conf.j2
Normal 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 %}
|
Loading…
Reference in a new issue