From a38c158f668ea4fed5047eaa6ba13e264a34a526 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 4 Jun 2026 19:27:11 +0300 Subject: [PATCH] Feat(init-system.sh): Check if the host was added to inventory --- playbooks/debian/init-system.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playbooks/debian/init-system.sh b/playbooks/debian/init-system.sh index 702c9f3..48294ff 100755 --- a/playbooks/debian/init-system.sh +++ b/playbooks/debian/init-system.sh @@ -21,6 +21,11 @@ fi host="$1" shift +if [ \! grep -Fqw "$host" ../hosts ]; then + echo "Host $host must be in the default inventory" >&2 + exit 1 +fi + ssh root@$host exec adduser phd # Ignore error: may already be created # Passwordless access isn't configured yet; use `ssh` connection sharing. ssh phd@$host exit && -- 2.47.3