Skip to content

Commit 8245d74

Browse files
LTSCommerceclaude
andcommitted
fix(ansible): anchor root_dir on ansible.cfg to kill vars_files skip warning
root_dir was "{{ inventory_dir }}/../../". inventory_dir is a host-scoped magic variable that is UNDEFINED during Ansible's early vars_files evaluation pass, so every `vars_files: - "{{ root_dir }}/..."` entry hit "skipping vars_files item due to an undefined variable" and silently skipped before being re-evaluated per-host (the value loaded anyway — a fragile limp that violates the project's fail-fast rule). Re-anchor on ansible.cfg's location, which is host-independent and resolves on the first pass: root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}" - 0 "skipping vars_files" warnings across every play and the full playbook-main.yml import chain (verified via --list-tasks) - move-proof: ansible.cfg never moves from the repo root, unlike playbook_dir (breaks if a play is relocated) - one uniform idiom; all 66 root_dir definitions converted across 65 playbooks; every existing {{ root_dir }} reference works unchanged - AnsibleStyle.md canonical pattern updated to match, with the WHY - drive-by: replace a mail-archive citation URL (embedded list email tripped the public-repo secret scanner) with the canonical bugs.debian.org URL for the same bug QA: ./scripts/qa-all.bash passes (exit 0). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent dc45f53 commit 8245d74

66 files changed

Lines changed: 75 additions & 69 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE/AnsibleStyle.md

Lines changed: 8 additions & 2 deletions

playbooks/imports/optional/archived/play-tlp-battery-optimisation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
name: TLP Battery Optimisation
1313
become: true
1414
vars:
15-
root_dir: "{{ inventory_dir }}/../../"
15+
root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}"
1616
tasks:
1717
- name: Install Packages
1818
ansible.builtin.dnf:

playbooks/imports/optional/common/play-advanced-kernel-management.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
become: true
66

77
vars:
8-
root_dir: "{{ inventory_dir }}/../../"
8+
root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}"
99

1010
tasks:
1111
# PKG-08 (F44): python3-dnf-plugin-versionlock install removed.

playbooks/imports/optional/common/play-claude-devtools.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Claude DevTools (ccdt) - On-Demand Session Viewer Installation
55
become: false
66
vars:
7-
root_dir: "{{ inventory_dir }}/../../"
7+
root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}"
88
ccdt_repo: "https://github.com/matt1398/claude-devtools"
99
ccdt_src_dir: "/opt/claude-devtools"
1010
ccdt_image: "claude-devtools"

playbooks/imports/optional/common/play-clean-paste.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
name: Clean Paste — Ctrl+Alt+V clipboard sanitiser
2020
become: true
2121
vars:
22-
root_dir: "{{ inventory_dir }}/../../"
22+
root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}"
2323
clean_paste_binary: "/home/{{ user_login }}/.local/bin/clean-paste"
2424
clean_paste_lib_dir: "/home/{{ user_login }}/.local/lib/clean-paste"
2525
clean_paste_registrar: "/home/{{ user_login }}/.local/lib/clean-paste/register-shortcut.py"

playbooks/imports/optional/common/play-cloudflare-warp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- hosts: desktop
44
become: true
55
vars:
6-
root_dir: "{{ inventory_dir }}/../../"
6+
root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}"
77
tasks:
88
# @see https://pkg.cloudflareclient.com/#rhel
99
- name: Install Repo

playbooks/imports/optional/common/play-collaboration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name: Collaboration Tools
1010
become: true
1111
vars:
12-
root_dir: "{{ inventory_dir }}/../../"
12+
root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}"
1313
tasks:
1414
# ── tmate ──────────────────────────────────────────────────────────────────
1515
# Instant terminal sharing via SSH URL. Wrapper scripts default to

playbooks/imports/optional/common/play-compression-helpers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Compression Helpers - installs `compress` and `uncompress` commands
55
become: true
66
vars:
7-
root_dir: "{{ inventory_dir }}/../../"
7+
root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}"
88
# Pin ouch version for reproducibility. Update deliberately.
99
# @see https://github.com/ouch-org/ouch/releases
1010
ouchVersion: "0.6.1"

playbooks/imports/optional/common/play-darktable-ai-appimage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
name: Install darktable AI Nightly (darktable-ai, with Sony A7V)
3838
become: true
3939
vars:
40-
root_dir: "{{ inventory_dir }}/../../"
40+
root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}"
4141

4242
# GitHub releases API for the rolling `nightly` tag.
4343
dt_ai_release_api: "https://api.github.com/repos/darktable-org/darktable/releases/tags/nightly"

playbooks/imports/optional/common/play-darktable-ai-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
name: Build and Install Darktable RPM with AI Features (USE_AI=ON)
3535
become: false
3636
vars:
37-
root_dir: "{{ inventory_dir }}/../../"
37+
root_dir: "{{ lookup('ansible.builtin.config', 'CONFIG_FILE') | dirname }}"
3838

3939
# darktable upstream release - bump these together
4040
darktable_version: "5.4.1"

0 commit comments

Comments
 (0)