mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-03-02 17:30:20 +00:00
This allows to manage groups of VMs across multiple infrastructure providers. It also adds support to create groups of VMs on OpenStack. WARNING: the syntax of workshopctl has changed slightly. Check READMEs for details.
29 lines
707 B
Bash
29 lines
707 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] $@"
|
|
export PSSH=$(which pssh || which parallel-ssh)
|
|
|
|
$PSSH -h $HOSTFILE -l ubuntu \
|
|
--par 100 \
|
|
-O LogLevel=ERROR \
|
|
-O UserKnownHostsFile=/dev/null \
|
|
-O StrictHostKeyChecking=no \
|
|
-O ForwardAgent=yes \
|
|
"$@"
|
|
}
|