From 0ab3b6a799786c4451850f367db38567f8c310a6 Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Sat, 8 Nov 2025 15:03:09 +0100 Subject: [PATCH] fix: Set git_repository_url using set_fact to avoid recursive loop - Use set_fact task to set git_repository_url instead of vars section - This prevents recursive loop when variable is referenced in tasks --- deployment/ansible/playbooks/deploy-application-code.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deployment/ansible/playbooks/deploy-application-code.yml b/deployment/ansible/playbooks/deploy-application-code.yml index ffe2609c..7ef740a2 100644 --- a/deployment/ansible/playbooks/deploy-application-code.yml +++ b/deployment/ansible/playbooks/deploy-application-code.yml @@ -7,7 +7,6 @@ vars: application_code_dest: "/home/deploy/michaelschiemer/current" git_repository_url_default: "https://git.michaelschiemer.de/michael/michaelschiemer.git" - git_repository_url: "{{ git_repository_url | default(git_repository_url_default) }}" # Determine branch based on environment git_branch: >- {%- if deployment_environment == 'staging' -%} @@ -20,6 +19,10 @@ deployment_environment: "{{ deployment_environment | default('production') }}" tasks: + - name: Set git_repository_url if not provided + set_fact: + git_repository_url: "{{ git_repository_url | default(git_repository_url_default) }}" + - name: Ensure Git is installed ansible.builtin.apt: name: git