From c645f2ae8e75c416d710d26bc4a558dd94ddd41d Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 2 May 2023 09:16:53 +0300 Subject: [PATCH] Redo backup_borg_location_exclude_patterns to ensure it doesn't contain empty strings Previously, if Postgres or MariaDB were disabled, an empty path (`''`) would be injected. I'm not sure how borg-backup would handle such paths, but I suppose we'd better not feed it such stuff. --- group_vars/mash_servers | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index f92ba0a..3cb824c 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -630,14 +630,15 @@ backup_borg_mysql_databases_password: "{{ mariadb_root_passsword if mariadb_enab backup_borg_mysql_databases_port: "{{ devture_postgres_connection_port if mariadb_enabled else 3306 }}" backup_borg_mysql_databases: "{{ mariadb_managed_databases | map(attribute='name') if mariadb_enabled else [] }}" - backup_borg_location_source_directories: - "{{ mash_playbook_base_path }}" -backup_borg_location_exclude_patterns: - - "{{ devture_postgres_data_path if devture_postgres_enabled else '' }}" - - "{{ mariadb_data_path if mariadb_enabled else '' }}" - +backup_borg_location_exclude_patterns: | + {{ + ([devture_postgres_data_path] if devture_postgres_enabled else []) + + + ([mariadb_data_path] if mariadb_enabled else []) + }} backup_borg_systemd_required_services_list: | {{