Apply Site User Data
You can provide site-specific Edge Installer configuration user data if you need to apply new values or override default values from the Edge Installer user data you created in EdgeForge.
Use the following steps to create an ISO file containing the additional user data. You will load the newly created ISO to a bootable device, such as a USB stick.
Prerequisites
-
A bootable device such as a USB drive, or a Preboot Execution Environment (PXE) server.
-
An Edge host with Palette Edge installed. Refer to Installation for more information.
-
mkisofs
, orgenisoimage
, or similar ISO management software.cdrtools
orwodim
for Windows.
Create ISO
-
Create a file called user-data that contains the additional configurations you want to override or inject. Ensure that the file starts with a line that only contains
#cloud-config
. Only include configurations you'd like to add or override. There is no need to include user data that was already present when the ISO image was build in the Build Edge Artifacts step.touch user-data
For example, you can include the following content in the user-data file to connect your Edge host to Wi-Fi. Replace
wifi-network-name
with the name of your Wi-Fi network and thewifi-password
with the password of your network. This requires wpa_supplicant to be included in your base OS image. For more information, refer to Connect Intel NUC Edge Host to Wifi.#cloud-config
install:
bind_mounts:
- /var/lib/wpa
stages:
network.before:
- name: "Connect to wifi"
commands:
- |
# Find the first wireless network interface
wireless_interface=""
for interface in $(ip link | grep -oP '^\d+: \K[^:]+(?=:)')
do
if [ -d "/sys/class/net/$interface/wireless" ]; then
wireless_interface=$interface
break
fi
done
# Check if a wireless interface was found and connect it to WiFi
if [ -n "$wireless_interface" ]; then
wpa_passphrase wifi-network-name wifi-password | tee /var/lib/wpa/wpa_supplicant.conf
wpa_supplicant -B -c /var/lib/wpa/wpa_supplicant.conf -i $wireless_interface
dhclient $wireless_interface
else
echo "No wireless network interface found."
fi -
Create an empty meta-data file:
touch meta-data
-
Create an ISO using the following command.
- macOS/Linux
- Windows
mkisofs -output site-user-data.iso -volid cidata -joliet -rock user-data meta-data
genisoimage -output site-user-data.iso -volid cidata -joliet -rock user-data meta-data
This generates an ISO file called site-user-data.iso in the current directory.
-
Flash your bootable device such as a USB drive with the ISO file you just created.
infoYou can use several software tools to create a bootable USB drive, such as balenaEtcher. For a PXE server, there are open source projects such as Fog or Windows Deployment Services for Windows.
-
Once the Edge host arrives at the physical site. Load the USB drive to the Edge host before powering it on. The Edge Installer will apply the new user data during the installation process.
Validate
You can validate that the ISO image is not corrupted by attempting to flash a bootable device. Most software that creates a bootable device will validate the ISO image before the flash process.
If you have SSH access, you can also SSH into the Edge host and locate your user-data file in either /oem
or
/run/stylus
. The site-specific user data is named user-data while the original user data file is named something
similar to 90_custom.yaml
. If you can find the files on the Edge host, it means the user data has been applied
successfully.
Next Steps
Before you register your Edge host with Palette you must have a tenant registration token. Review the Create Registration Token guide for steps on how to create a tenant registration token.