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

Merge branch 'th/mysql-binlog' into 'master'

mysql: Add options to enable binlog

See merge request !8
parents 1014451f 5bd2f0dd
No related branches found
No related tags found
1 merge request!8mysql: Add options to enable binlog
Pipeline #4396 passed
...@@ -8,3 +8,6 @@ mysql_backup_user: "backup" ...@@ -8,3 +8,6 @@ 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
# It is the admin’s responsibility to further configure binlogs, especially
# purging them if required.
mysql_enable_binlog: false
---
- name: Reload systemd
systemd:
daemon_reload: true
- name: Restart mariadb.service
systemd:
name: mariadb.service
state: restarted
...@@ -62,3 +62,22 @@ ...@@ -62,3 +62,22 @@
file: file:
path: /etc/cron.d/mysql-snapshot path: /etc/cron.d/mysql-snapshot
state: absent state: absent
- name: Create mariadb.service override directory
file:
path: /etc/systemd/system/mariadb.service.d
state: directory
owner: root
group: root
mode: '0755'
- name: Configure binlog
template:
src: override.conf
dest: /etc/systemd/system/mariadb.service.d/override.conf
owner: root
group: root
mode: '0644'
notify:
- Reload systemd
- Restart mariadb.service
[Service]
Environment=MYSQLD_OPTS={{ '--log-bin' if mysql_enable_binlog }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment