From 9b8be9d3025193de47548eebf2f0889618a45ca9 Mon Sep 17 00:00:00 2001 From: Username Date: Tue, 17 Feb 2026 23:22:29 +0100 Subject: [PATCH] tools: use toolkit inventory for all ansible commands Route ansible_cmd through ppf inventory instead of /opt/ansible default. Eliminates dynamic inventory warnings and connects via WireGuard IPs. --- tools/lib/ppf-common.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/lib/ppf-common.sh b/tools/lib/ppf-common.sh index bccfba0..40c7641 100644 --- a/tools/lib/ppf-common.sh +++ b/tools/lib/ppf-common.sh @@ -10,6 +10,7 @@ set -eu PPF_DIR="${PPF_DIR:-$HOME/git/ppf}" ANSIBLE_DIR="/opt/ansible" ANSIBLE_VENV="${ANSIBLE_DIR}/venv/bin/activate" +PPF_INVENTORY="${PPF_DIR}/tools/playbooks/inventory.ini" # --------------------------------------------------------------------------- # Host topology @@ -97,25 +98,25 @@ hosts_csv() { # --------------------------------------------------------------------------- # Ansible wrapper # --------------------------------------------------------------------------- -# Runs ansible with venv activated and ANSIBLE_REMOTE_TMP set. +# Runs ansible with toolkit inventory via venv. # Usage: ansible_cmd ansible_cmd() { ( # shellcheck disable=SC1090 . "$ANSIBLE_VENV" cd "$ANSIBLE_DIR" - ANSIBLE_REMOTE_TMP=/tmp/.ansible ansible "$@" + ansible -i "$PPF_INVENTORY" "$@" ) } -# Runs ansible-playbook with venv activated and ANSIBLE_REMOTE_TMP set. +# Runs ansible-playbook with toolkit inventory via venv. # Usage: ansible_playbook_cmd ansible_playbook_cmd() { ( # shellcheck disable=SC1090 . "$ANSIBLE_VENV" cd "$ANSIBLE_DIR" - ANSIBLE_REMOTE_TMP=/tmp/.ansible ansible-playbook "$@" + ansible-playbook "$@" ) }