From 163460c22e17cb4e30a041fe93fa54fc777d5341 Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Sat, 8 Nov 2025 15:04:04 +0100 Subject: [PATCH] fix: Use separate variable git_repo_url to avoid recursive loop - Use git_repo_url instead of git_repository_url in tasks - Set git_repo_url based on whether git_repository_url is provided - This completely avoids the recursive loop issue --- .../playbooks/deploy-application-code.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/deployment/ansible/playbooks/deploy-application-code.yml b/deployment/ansible/playbooks/deploy-application-code.yml index 7ef740a2..f03e9fb4 100644 --- a/deployment/ansible/playbooks/deploy-application-code.yml +++ b/deployment/ansible/playbooks/deploy-application-code.yml @@ -21,7 +21,18 @@ tasks: - name: Set git_repository_url if not provided set_fact: - git_repository_url: "{{ git_repository_url | default(git_repository_url_default) }}" + git_repo_url: "{{ git_repository_url | default(git_repository_url_default) }}" + when: git_repository_url is not defined or git_repository_url == "" + + - name: Use default git_repository_url if not set + set_fact: + git_repo_url: "{{ git_repository_url_default }}" + when: git_repository_url is not defined or git_repository_url == "" + + - name: Use provided git_repository_url if set + set_fact: + git_repo_url: "{{ git_repository_url }}" + when: git_repository_url is defined and git_repository_url != "" - name: Ensure Git is installed ansible.builtin.apt: @@ -46,7 +57,7 @@ - name: Clone repository (if not exists) ansible.builtin.git: - repo: "{{ git_repository_url }}" + repo: "{{ git_repo_url }}" dest: "{{ application_code_dest }}" version: "{{ git_branch }}" force: no @@ -61,7 +72,7 @@ - name: Update repository (if exists) ansible.builtin.git: - repo: "{{ git_repository_url }}" + repo: "{{ git_repo_url }}" dest: "{{ application_code_dest }}" version: "{{ git_branch }}" force: yes