Ensure database server is running via systemd
This commit is contained in:
parent
dd9b42a8b8
commit
66b59e15f6
5 changed files with 16 additions and 24 deletions
4
files/systemd/override.conf
Normal file
4
files/systemd/override.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Ansible manages
|
||||
|
||||
[Service]
|
||||
Restart=always
|
|
@ -9,7 +9,6 @@
|
|||
name: mariadb
|
||||
state: restarted
|
||||
|
||||
- name: reload monit
|
||||
service:
|
||||
name: monit
|
||||
state: reloaded
|
||||
- name: Reload systemd
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: true
|
||||
|
|
|
@ -5,3 +5,12 @@
|
|||
dest: "/etc/mysql/mariadb.conf.d/90-{{ ansible_hostname }}.cnf"
|
||||
mode: "0644"
|
||||
notify: restart mariadb
|
||||
|
||||
- name: "Configuration | Copy systemd override"
|
||||
ansible.builtin.file:
|
||||
src: systemd/override.conf
|
||||
dest: /etc/systemd/systemd/mariadb.service.d/
|
||||
mode: "0644"
|
||||
notify:
|
||||
- Reload systemd
|
||||
- restart mariadb
|
||||
|
|
|
@ -16,11 +16,6 @@
|
|||
ansible.builtin.import_tasks: backup.yml
|
||||
tags: backup
|
||||
|
||||
- name: Monit
|
||||
ansible.builtin.import_tasks: monit.yml
|
||||
when: "'monit' in ansible_facts.packages"
|
||||
tags: monit
|
||||
|
||||
- name: Configuration
|
||||
ansible.builtin.import_tasks: configuration.yml
|
||||
tags: configuration
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
---
|
||||
- name: "Monit | Create sql user"
|
||||
community.mysql.mysql_user:
|
||||
name: "{{ monit_sql_user }}"
|
||||
password: "{{ monit_sql_password }}"
|
||||
state: present
|
||||
login_unix_socket: "{{ mysql_socket }}"
|
||||
login_user: root
|
||||
|
||||
- name: "Monit | Copy Monit configuration"
|
||||
ansible.builtin.template:
|
||||
src: monit.conf.j2
|
||||
dest: /etc/monit/conf-enabled/mariadb
|
||||
mode: "0600"
|
||||
notify: reload monit
|
Loading…
Reference in a new issue