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
|
## Backup
|
||||||
|
|
||||||
For daily backups we use automysqlbackup. You can configure it via the dict
|
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
|
notify: restart mariadb
|
||||||
|
|
||||||
- name: "Configuration | Copy systemd override"
|
- name: "Configuration | Copy systemd override"
|
||||||
ansible.builtin.copy:
|
ansible.builtin.template:
|
||||||
src: systemd/override.conf
|
src: systemd/override.conf.j2
|
||||||
dest: /etc/systemd/systemd/mariadb.service.d/
|
dest: /etc/systemd/systemd/mariadb.service.d/override.conf
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
notify:
|
notify:
|
||||||
- Reload systemd
|
- 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