From 7a271896a8ea57002670456aec4840e6805c5468 Mon Sep 17 00:00:00 2001 From: Username Date: Tue, 17 Feb 2026 23:38:13 +0100 Subject: [PATCH] ppf-common: fix ad-hoc ansible for toolkit inventory Add --become to ansible_cmd (needed when connecting as ansible user). Add cd /tmp to podman_cmd so sudo -u podman doesn't fail on inaccessible /home/ansible cwd. --- tools/lib/ppf-common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/ppf-common.sh b/tools/lib/ppf-common.sh index 40c7641..d3cbb47 100644 --- a/tools/lib/ppf-common.sh +++ b/tools/lib/ppf-common.sh @@ -105,7 +105,7 @@ ansible_cmd() { # shellcheck disable=SC1090 . "$ANSIBLE_VENV" cd "$ANSIBLE_DIR" - ansible -i "$PPF_INVENTORY" "$@" + ansible -i "$PPF_INVENTORY" --become "$@" ) } @@ -130,7 +130,7 @@ podman_cmd() { local host="$1"; shift local cmd="$*" ansible_cmd "$host" -m raw -a \ - "uid=\$(id -u podman) && sudo -u podman XDG_RUNTIME_DIR=/run/user/\$uid $cmd" + "uid=\$(id -u podman) && cd /tmp && sudo -u podman XDG_RUNTIME_DIR=/run/user/\$uid $cmd" } # Run a podman-compose subcommand on a remote host.