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