mariadb: Benenne task-file eindeutiger, Setze Backkupdir

This commit is contained in:
phil 2022-06-09 08:38:07 +02:00
parent 18e4930e4e
commit c13c5d63bc
3 changed files with 27 additions and 22 deletions

24
tasks/backup.yml Normal file
View file

@ -0,0 +1,24 @@
---
- name: "backup | automysqlbackup - Definiere Postbackup-Skript"
lineinfile:
path: /etc/default/automysqlbackup
regexp: '^#POSTBACKUP='
line: POSTBACKUP="{{ local_scripts_dir }}/automysqlbackup_post_script"
- name: "backup | automysqlbackup - Definiere Backupdir"
lineinfile:
path: /etc/default/automysqlbackup
regexp: '^BACKUPDIR='
line: 'BACKUPDIR="{{ automysqlbackup_backupdir|default("/var/lib/automysqlbackup") }}"'
- name: "backup | Prüfe scripts-Verzeichnis"
file:
path: "{{ local_scripts_dir }}"
state: touch
changed_when: false
- name: "backup | Kopiere automysqlbackup-Postscript"
copy:
src: automysqlbackup_post_script
dest: "{{ local_scripts_dir }}/"
mode: 0755

View file

@ -1,7 +1,6 @@
--- ---
# tasks file for mariadb
- import_tasks: packages.yml - import_tasks: packages.yml
tags: packages
- name: "Munin" - name: "Munin"
include_tasks: munin.yml include_tasks: munin.yml
@ -11,8 +10,8 @@
- import_tasks: cron.yml - import_tasks: cron.yml
tags: cron tags: cron
- import_tasks: mariadb.yml - import_tasks: backup.yml
tags: mariadb tags: backup
- import_tasks: monit.yml - import_tasks: monit.yml
tags: monit tags: monit

View file

@ -1,18 +0,0 @@
---
- name: "mariadb: Richte automysqlbackup ein"
lineinfile:
path: /etc/default/automysqlbackup
regexp: '^#POSTBACKUP='
line: POSTBACKUP="{{ local_scripts_dir }}/automysqlbackup_post_script"
- name: "mariab: Prüfe scripts-Verzeichnis"
file:
path: "{{ local_scripts_dir }}"
state: touch
changed_when: false
- name: "mariadb: Richte Backup ein 2"
copy:
src: automysqlbackup_post_script
dest: "{{ local_scripts_dir }}/"
mode: 0755