From: Oleg Broytman Date: Sun, 28 Jul 2019 16:39:21 +0000 (+0300) Subject: Feat(debian-init-system): Require single host X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=32c11aba66d9fc0cf3bf4efb38afccc300b546c7;p=ansible.git Feat(debian-init-system): Require single host As the script asks for the root password it can only initialize a single host. --- 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"