From 71f429d8aa156db3d45c43240c6c046e29371f3f Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 27 Mar 2026 11:59:40 +0100 Subject: [PATCH] Fix check for host-specific git vars file before including --- roles/common/tasks/git.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/roles/common/tasks/git.yml b/roles/common/tasks/git.yml index 51d0ae5..578f30c 100644 --- a/roles/common/tasks/git.yml +++ b/roles/common/tasks/git.yml @@ -331,12 +331,17 @@ # --- # Read in host specific vars file if exists +- name: (git.yml) Check for host specific git vars file + stat: + path: "vars/git-{{ inventory_hostname }}.yml" + register: git_host_vars_file + tags: + - git-other-repositories + - name: (git.yml) Include only files matching git-.yml (2.2) include_vars: - dir: vars - extensions: - - yml - files_matching: "git-{{ inventory_hostname }}.yml" + file: "vars/git-{{ inventory_hostname }}.yml" + when: git_host_vars_file.stat.exists tags: - git-other-repositories