Skip to content

Commit

Permalink
kickstart esxi: Remove the -s option from wget (#207)
Browse files Browse the repository at this point in the history
## Description

The VMware installer was previously relying on wget's "-s" or spider option to determine whether or not a particular URL was accessible while handling the customdata portion of the kickstart. This option is not valid on the version of wget which ships with current closed-source ESXi installers.

## Why is this needed

This change fixes a bug related to the customdata logic responsible for executing the kickstart postinstall scripts and kickstart firstboot install scripts provided via customdata.

Fixes: #

## How Has This Been Tested?
CI testing


## How are existing users impacted? What migration steps/scripts do we need?

Fixes customdata bug and unblocks further VMware VCF configuration.


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
mergify[bot] authored Sep 30, 2021
2 parents e61faf0 + 1edda63 commit 36f12f8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
26 changes: 12 additions & 14 deletions installers/vmware/kickstart-esxi.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,12 @@ fi
# Kickstart firstboot supplemental config URL
if [ "$kickstartfburl" != "null" ]; then
echo "Using supplemental kickstart firstboot URL: $kickstartfburl"
if wget -q -s $kickstartfburl; then
wget -q $kickstartfburl -O /tmp/ks-firstboot-sup.sh
if wget -q "$kickstartfburl" -O /tmp/ks-firstboot-sup.sh; then
echo "========Begin execution of supplemental firstboot kickstart"
chmod +x /tmp/ks-firstboot-sup.sh && /tmp/ks-firstboot-sup.sh
echo "========End execution of supplemental firstboot kickstart"
else
echo "ERROR: Custom kickstart firstboot URL is NOT accessible!"
echo "ERROR: Custom kickstart firstboot URL '$kickstartfburl' is NOT accessible!"
exit 1
fi
else
Expand Down Expand Up @@ -308,18 +307,17 @@ kickstartpishellcmd=$(custom_data "['kickstart']['postinstall_shell_cmd']")
# Kickstart postinstall supplemental config URL
if [ "$kickstartpiurl" != "null" ]; then
echo "Using supplemental kickstart postinstall URL: $kickstartpiurl"
if wget -q -s $kickstartpiurl; then
wget -q $kickstartpiurl -O /tmp/ks-postinstall-sup.sh
echo "========Begin execution of supplemental postinstall kickstart"
chmod +x /tmp/ks-postinstall-sup.sh && /tmp/ks-postinstall-sup.sh
echo "========End execution of supplemental postinstall kickstart"
else
echo "ERROR: Custom kickstart postinstall URL is NOT accessible!"
exit 1
fi
echo "Using supplemental kickstart postinstall URL: $kickstartpiurl"
if wget -q "$kickstartpiurl" -O /tmp/ks-postinstall-sup.sh; then
echo "========Begin execution of supplemental postinstall kickstart"
chmod +x /tmp/ks-postinstall-sup.sh && /tmp/ks-postinstall-sup.sh
echo "========End execution of supplemental postinstall kickstart"
else
echo "ERROR: Custom kickstart postinstall URL '$kickstartpiurl' is NOT accessible!"
exit 1
fi
else
echo "Skipping supplemental kickstart postinstall URL"
echo "Skipping supplemental kickstart postinstall URL"
fi
# Kickstart postinstall supplemental shell commands
Expand Down
26 changes: 12 additions & 14 deletions installers/vmware/testdata/vmware_base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,12 @@ fi
# Kickstart firstboot supplemental config URL
if [ "$kickstartfburl" != "null" ]; then
echo "Using supplemental kickstart firstboot URL: $kickstartfburl"
if wget -q -s $kickstartfburl; then
wget -q $kickstartfburl -O /tmp/ks-firstboot-sup.sh
if wget -q "$kickstartfburl" -O /tmp/ks-firstboot-sup.sh; then
echo "========Begin execution of supplemental firstboot kickstart"
chmod +x /tmp/ks-firstboot-sup.sh && /tmp/ks-firstboot-sup.sh
echo "========End execution of supplemental firstboot kickstart"
else
echo "ERROR: Custom kickstart firstboot URL is NOT accessible!"
echo "ERROR: Custom kickstart firstboot URL '$kickstartfburl' is NOT accessible!"
exit 1
fi
else
Expand Down Expand Up @@ -274,18 +273,17 @@ kickstartpishellcmd=$(custom_data "['kickstart']['postinstall_shell_cmd']")

# Kickstart postinstall supplemental config URL
if [ "$kickstartpiurl" != "null" ]; then
echo "Using supplemental kickstart postinstall URL: $kickstartpiurl"
if wget -q -s $kickstartpiurl; then
wget -q $kickstartpiurl -O /tmp/ks-postinstall-sup.sh
echo "========Begin execution of supplemental postinstall kickstart"
chmod +x /tmp/ks-postinstall-sup.sh && /tmp/ks-postinstall-sup.sh
echo "========End execution of supplemental postinstall kickstart"
else
echo "ERROR: Custom kickstart postinstall URL is NOT accessible!"
exit 1
fi
echo "Using supplemental kickstart postinstall URL: $kickstartpiurl"
if wget -q "$kickstartpiurl" -O /tmp/ks-postinstall-sup.sh; then
echo "========Begin execution of supplemental postinstall kickstart"
chmod +x /tmp/ks-postinstall-sup.sh && /tmp/ks-postinstall-sup.sh
echo "========End execution of supplemental postinstall kickstart"
else
echo "ERROR: Custom kickstart postinstall URL '$kickstartpiurl' is NOT accessible!"
exit 1
fi
else
echo "Skipping supplemental kickstart postinstall URL"
echo "Skipping supplemental kickstart postinstall URL"
fi

# Kickstart postinstall supplemental shell commands
Expand Down

0 comments on commit 36f12f8

Please sign in to comment.