From b8d11180605fbf193e76fba04bb63b5ea4908dcf Mon Sep 17 00:00:00 2001 From: Colin Wilk Date: Fri, 26 Jun 2026 21:42:26 +0000 Subject: backup_script!: ensure unique blockinfile marker The blockinfile marker was only keyed by borg_server_host_url, causing backup blocks to overwrite each other when running the role multiple times on the same host with different repositories. This change includes borg_repo_name in the marker, allowing multiple backup blocks to coexist in the base script. Now running the role twice with different borg_repo_name values creates separate blocks instead of overwriting. This ensures idempotent behavior and allows the base script to accumulate all backup targets as documented. Before: marker for "borg-server" (overwrites on second run) After: marker for "borg-server/configs" and "borg-server/home-data" --- tasks/client_create_scripts_each.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/client_create_scripts_each.yml b/tasks/client_create_scripts_each.yml index 8e01174..b91c385 100644 --- a/tasks/client_create_scripts_each.yml +++ b/tasks/client_create_scripts_each.yml @@ -21,7 +21,7 @@ - name: Insert Backup job block into scripts ansible.builtin.blockinfile: path: "{{ script_location }}" - marker: "## {mark} ANSIBLE MANAGED BLOCK for server: {{ borg_server_host_url }}" + marker: "## {mark} ANSIBLE MANAGED BLOCK for {{ borg_server_host_url }}/{{ borg_repo_name }}" block: | export BORG_PASSPHRASE={{ borg_passphrase | quote }} borg create -C {{ borg_compression }} \ -- cgit v1.2.3