From bfd91fcb610b3728141d157f86f1a6be164caa84 Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Sat, 8 Nov 2025 15:58:09 +0100 Subject: [PATCH] fix: Add Git variables and improve bool check for image pull - Add Git repository variables (GIT_REPOSITORY_URL, GIT_TOKEN, GIT_USERNAME, GIT_PASSWORD) to environment - Load Git variables from vault or defaults - Add Git variables to .env file creation - Improve registry_accessible check with 'is defined' guard - Fixes missing GIT_* environment variable warnings in docker compose --- deployment/ansible/playbooks/deploy-image.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/deployment/ansible/playbooks/deploy-image.yml b/deployment/ansible/playbooks/deploy-image.yml index 759acdb2..5c5c63e7 100644 --- a/deployment/ansible/playbooks/deploy-image.yml +++ b/deployment/ansible/playbooks/deploy-image.yml @@ -52,6 +52,10 @@ minio_root_user: "{{ minio_root_user | default(vault_minio_root_user | default('minioadmin')) }}" minio_root_password: "{{ minio_root_password | default(vault_minio_root_password | default('')) }}" secrets_dir: "{{ secrets_dir | default('./secrets') }}" + git_repository_url: "{{ git_repository_url | default(vault_git_repository_url | default('')) }}" + git_token: "{{ git_token | default(vault_git_token | default('')) }}" + git_username: "{{ git_username | default(vault_git_username | default('')) }}" + git_password: "{{ git_password | default(vault_git_password | default('')) }}" no_log: yes - name: Determine Docker registry password from vault or extra vars @@ -99,7 +103,7 @@ name: "{{ deploy_image }}" source: pull pull: true - when: registry_accessible == 'true' + when: registry_accessible is defined and registry_accessible == 'true' register: image_pull_result ignore_errors: yes failed_when: false @@ -154,6 +158,10 @@ MINIO_ROOT_USER={{ minio_root_user | default('minioadmin') }} MINIO_ROOT_PASSWORD={{ minio_root_password | default('') }} SECRETS_DIR={{ secrets_dir | default('./secrets') }} + GIT_REPOSITORY_URL={{ git_repository_url | default('') }} + GIT_TOKEN={{ git_token | default('') }} + GIT_USERNAME={{ git_username | default('') }} + GIT_PASSWORD={{ git_password | default('') }} owner: "{{ ansible_user }}" group: "{{ ansible_user }}" mode: '0600' @@ -172,6 +180,10 @@ MINIO_ROOT_USER: "{{ minio_root_user | default('minioadmin') }}" MINIO_ROOT_PASSWORD: "{{ minio_root_password | default('') }}" SECRETS_DIR: "{{ secrets_dir | default('./secrets') }}" + GIT_REPOSITORY_URL: "{{ git_repository_url | default('') }}" + GIT_TOKEN: "{{ git_token | default('') }}" + GIT_USERNAME: "{{ git_username | default('') }}" + GIT_PASSWORD: "{{ git_password | default('') }}" - name: Wait for containers to start ansible.builtin.pause: