You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
YQ is more necessary on the remote host than the local host that runs
the hyperconverged-lab script, so warn about it not getting installed
locally but fail if not present on the remote host.
Copy file name to clipboardExpand all lines: scripts/hyperconverged-lab.sh
+20-6Lines changed: 20 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,13 @@ RUN_EXTRAS=0
8
8
INCLUDE_LIST=()
9
9
EXCLUDE_LIST=()
10
10
11
+
# yq installation constants
12
+
YQ_VERSION="v4.2.0"
13
+
YQ_BINARY="yq_linux_amd64"
14
+
11
15
functioninstallYq() {
12
-
export VERSION=v4.2.0
13
-
export BINARY=yq_linux_amd64
14
-
if wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - | tar xz && sudo mv ${BINARY} /usr/local/bin/yq;then
15
-
echo"Successfully installed yq version ${VERSION}"
16
+
if wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}.tar.gz -O - | tar xz && sudo mv ${YQ_BINARY} /usr/local/bin/yq;then
17
+
echo"Successfully installed yq version ${YQ_VERSION}"
16
18
return 0
17
19
else
18
20
echo"Failed to install yq"
@@ -24,8 +26,7 @@ function installYq() {
24
26
if! yq --version 2> /dev/null;then
25
27
echo"yq is not installed. Attempting to install yq"
26
28
if! installYq;then
27
-
echo"Unable to proceed without yq. Exiting."
28
-
exit 1
29
+
echo"[WARNING] Failed to install yq locally"
29
30
fi
30
31
fi
31
32
@@ -437,6 +438,19 @@ if [ ! -d "/etc/genestack" ]; then
437
438
sudo chown \${USER}:\${USER} -R /etc/genestack
438
439
fi
439
440
441
+
# Install yq on the remote host if not already present
442
+
if ! command -v yq &> /dev/null; then
443
+
echo "Installing yq on remote host..."
444
+
if wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}.tar.gz -O - | tar xz && sudo mv ${YQ_BINARY} /usr/local/bin/yq; then
445
+
echo "Successfully installed yq version ${YQ_VERSION} on remote host"
446
+
else
447
+
echo "Failed to install yq on remote host"
448
+
exit 1
449
+
fi
450
+
else
451
+
echo "yq already available on remote host: \$(yq --version)"
452
+
fi
453
+
440
454
# We need to clobber the sample or else we get a bogus LB vip
0 commit comments