From: Oleg Broytman Date: Thu, 4 Jun 2026 16:27:11 +0000 (+0300) Subject: Feat(init-system.sh): Check if the host was added to inventory X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a38c158f668ea4fed5047eaa6ba13e264a34a526;p=ansible.git Feat(init-system.sh): Check if the host was added to inventory --- 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 &&