mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-05-21 16:22:51 +00:00
Summary of changes: - "workshopctl" is now "labctl" - it can handle deployment of VMs but also of managed Kubernetes clusters (and therefore, it replaces the "prepare-tf" directory) - support for many more providers has been added Check the README.md, in particular the "directory structure"; it has the most important information.
30 lines
759 B
Bash
30 lines
759 B
Bash
# This file can be sourced in order to directly run commands on
|
|
# a group of VMs whose IPs are located in ips.txt of the directory in which
|
|
# the command is run.
|
|
|
|
pssh() {
|
|
if [ -z "$TAG" ]; then
|
|
>/dev/stderr echo "Variable \$TAG is not set."
|
|
return
|
|
fi
|
|
|
|
HOSTFILE="tags/$TAG/ips.txt"
|
|
|
|
[ -f $HOSTFILE ] || {
|
|
>/dev/stderr echo "Hostfile $HOSTFILE not found."
|
|
return
|
|
}
|
|
|
|
echo "[parallel-ssh] $@"
|
|
|
|
$(which pssh) -h $HOSTFILE -l ubuntu \
|
|
--par ${PSSH_PARALLEL_CONNECTIONS-100} \
|
|
--timeout 300 \
|
|
-O LogLevel=ERROR \
|
|
-O IdentityFile=tags/$TAG/id_rsa \
|
|
-O UserKnownHostsFile=/dev/null \
|
|
-O StrictHostKeyChecking=no \
|
|
-O ForwardAgent=yes \
|
|
"$@"
|
|
}
|