From c13c5d63bc37b3e832e8f0ccca9de9156ea9ef91 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 9 Jun 2022 08:38:07 +0200 Subject: [PATCH] mariadb: Benenne task-file eindeutiger, Setze Backkupdir --- tasks/backup.yml | 24 ++++++++++++++++++++++++ tasks/main.yml | 7 +++---- tasks/mariadb.yml | 18 ------------------ 3 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 tasks/backup.yml delete mode 100644 tasks/mariadb.yml diff --git a/tasks/backup.yml b/tasks/backup.yml new file mode 100644 index 0000000..59c4fa9 --- /dev/null +++ b/tasks/backup.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 05a0aa9..24bbe96 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,6 @@ --- -# tasks file for mariadb - - import_tasks: packages.yml + tags: packages - name: "Munin" include_tasks: munin.yml @@ -11,8 +10,8 @@ - import_tasks: cron.yml tags: cron -- import_tasks: mariadb.yml - tags: mariadb +- import_tasks: backup.yml + tags: backup - import_tasks: monit.yml tags: monit diff --git a/tasks/mariadb.yml b/tasks/mariadb.yml deleted file mode 100644 index 6b57c00..0000000 --- a/tasks/mariadb.yml +++ /dev/null @@ -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