From 17cebecd31abc3e3d05a0b7329fed3df69aab8c9 Mon Sep 17 00:00:00 2001 From: "Ben D." Date: Sat, 14 Mar 2026 17:01:29 -0700 Subject: [PATCH] add a git pull before the commit/push to handle this gracefully when multiple nodes run sequentially --- roles/hypervisor_backup_config/tasks/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/hypervisor_backup_config/tasks/main.yml b/roles/hypervisor_backup_config/tasks/main.yml index f39fbb3..054aac3 100644 --- a/roles/hypervisor_backup_config/tasks/main.yml +++ b/roles/hypervisor_backup_config/tasks/main.yml @@ -83,6 +83,14 @@ delegate_to: localhost changed_when: false + - name: Git | Pull latest before committing + ansible.builtin.shell: | + cd {{ pve_config_git_repo_dir }} + git pull origin {{ pve_config_git_branch }} --rebase + delegate_to: localhost + when: git_status.stdout != "" + changed_when: false + - name: Git | Stage backup files ansible.builtin.shell: | cd {{ pve_config_git_repo_dir }}