From 3ba2dcbb7846fbc3fe4c0b1698061d5fe44dd84e Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Mon, 6 Jul 2020 06:02:34 +0200 Subject: [PATCH] backup postgresql db handling --- tasks/backup.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/backup.yaml b/tasks/backup.yaml index 9555dde..0b852f2 100644 --- a/tasks/backup.yaml +++ b/tasks/backup.yaml @@ -17,3 +17,10 @@ > "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}/database.mysql" args: stdin: "{{nextcloud_database_pass}}" + when: nextcloud_database_type == "mysql" + +- name: drop postgresql database + shell: sudo -u postgres pg_dump -O + > "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}/database.pgsql" + delegate_to: "{{ (nextcloud_database_host != 'localhost') | ternary(nextcloud_database_host,inventory_hostname) }}" + when: nextcloud_database_type == "postgresql"