Skip to content
Snippets Groups Projects
Commit 8eb5e00c authored by Thomas Schneider's avatar Thomas Schneider
Browse files

mysql: Add options to enable binlog

parent 1014451f
No related branches found
No related tags found
No related merge requests found
Pipeline #4381 passed
...@@ -8,3 +8,4 @@ mysql_backup_user: "backup" ...@@ -8,3 +8,4 @@ mysql_backup_user: "backup"
mysql_backup_password: "{{ lookup('passwordstore', 'db/{{ ansible_hostname }}-mysql-backup create=true length=20') }}" mysql_backup_password: "{{ lookup('passwordstore', 'db/{{ ansible_hostname }}-mysql-backup create=true length=20') }}"
mysql_rsnapshot: false mysql_rsnapshot: false
mysql_enable_binlog: false
[Service]
Environment=MYSQLD_OPTS=--log-bin
---
- name: Reload systemd
systemd:
daemon_reload: true
- name: Restart mariadb.service
systemd:
name: mariadb.service
state: restarted
...@@ -62,3 +62,24 @@ ...@@ -62,3 +62,24 @@
file: file:
path: /etc/cron.d/mysql-snapshot path: /etc/cron.d/mysql-snapshot
state: absent state: absent
- when: mysql_enable_binlog
block:
- name: Create mariadb.service override directory
file:
path: /etc/systemd/system/mariadb.service.d
state: directory
owner: root
group: root
mode: '0755'
- name: Enable binlog
copy:
src: override.conf
dest: /etc/systemd/system/mariadb.service.d/override.conf
owner: root
group: root
mode: '0644'
notify:
- Reload systemd
- Restart mariadb.service
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment