From ed1187d1c3ae503323d627e36d5da5f794efe7dd Mon Sep 17 00:00:00 2001 From: sjat Date: Thu, 18 Jun 2026 13:04:54 +0200 Subject: [PATCH] fix(integration-vm): point ansible -i at hosts.yml, not the run dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver passed -i / (a directory); ansible's directory-inventory loader then parsed sibling files (notably 'current', which holds the real host string 'askari') as INI inventory, creating phantom hosts incl. the real askari with its full hostvars — violating the single-host safety invariant (and a hard error in ansible 2.18 on the binary qcow2/seed files). Point -i at the single hosts.yml file; ansible still loads the adjacent group_vars symlink. (review C1) Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/integration-vm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/integration-vm.py b/scripts/integration-vm.py index 191cf60..aa96291 100644 --- a/scripts/integration-vm.py +++ b/scripts/integration-vm.py @@ -254,7 +254,7 @@ def apply(host, certs): extra += ["-e", f"@{INTEG_DIR / f}"] extra += ["-e", f"@{cert_file(certs)}"] for step in prof["applies"]: - cmd = [".venv/bin/ansible-playbook", "-i", str(RUN_DIR) + "/", + cmd = [".venv/bin/ansible-playbook", "-i", str(RUN_DIR / "hosts.yml"), f"playbooks/{step['playbook']}", "--limit", name] if step.get("tags"): cmd += ["--tags", ",".join(step["tags"])] @@ -299,7 +299,7 @@ def run_assert(host, certs): for f in prof.get("extra_vars_files", []): extra += ["-e", f"@{INTEG_DIR / f}"] extra += ["-e", f"@{cert_file(certs)}"] - cmd = [".venv/bin/ansible-playbook", "-i", str(RUN_DIR) + "/", + cmd = [".venv/bin/ansible-playbook", "-i", str(RUN_DIR / "hosts.yml"), "tests/integration/verify.yml", "--limit", name] + extra r = sh(cmd, cwd=str(REPO_ROOT), check=False) if r.returncode != 0: