]> git.phdru.name Git - ansible.git/commitdiff
Feat(debian-init-system): Require single host
authorOleg Broytman <phd@phdru.name>
Sun, 28 Jul 2019 16:39:21 +0000 (19:39 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 28 Jul 2019 16:39:21 +0000 (19:39 +0300)
As the script asks for the root password
it can only initialize a single host.

playbooks/debian-init-system.sh

index 1d4e537aa548298e2e704bcdac714c0f7c6abebf..d53c6a55c38c50c2e84376515106770adfdcb3ae 100755 (executable)
@@ -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"