From 32c11aba66d9fc0cf3bf4efb38afccc300b546c7 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 28 Jul 2019 19:39:21 +0300 Subject: [PATCH] Feat(debian-init-system): Require single host As the script asks for the root password it can only initialize a single host. --- playbooks/debian-init-system.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/playbooks/debian-init-system.sh b/playbooks/debian-init-system.sh index 1d4e537..d53c6a5 100755 --- a/playbooks/debian-init-system.sh +++ b/playbooks/debian-init-system.sh @@ -1,8 +1,17 @@ #! /bin/sh +if [ -z "$1" ]; then + echo "Usage: $0 host" >&2 + exit 1 +fi + +host="$1" +shift + cd "`dirname \"$0\"`" && # Passwordless access isn't configured yet; use `ssh` connection sharing. # `sudo` isn't configured yet too; use `su` and ask for root password. -ansible-playbook debian/init-system.yml "$@" --become-method=su -K && -exec ansible-playbook debian/init-system2.yml "$@" +ansible-playbook debian/init-system.yml "$@" -e hosts="$host" \ + --become-method=su -K && +exec ansible-playbook debian/init-system2.yml "$@" -e hosts="$host" -- 2.39.5