mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-03-04 18:30:38 +00:00
24 lines
558 B
Plaintext
Executable File
24 lines
558 B
Plaintext
Executable File
# This file can be sourced in order to directly run commands on
|
|
# a batch of VMs whose IPs are located in ips.txt of the directory in which
|
|
# the command is run.
|
|
|
|
pssh () {
|
|
HOSTFILE="ips.txt"
|
|
|
|
[ -f $HOSTFILE ] || {
|
|
echo "No hostfile found at $HOSTFILE"
|
|
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 \
|
|
"$@"
|
|
}
|