Skip to content

Commit

Permalink
edit yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
lennessyy committed Jan 24, 2024
1 parent 71aedba commit cd31974
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 74 deletions.
33 changes: 17 additions & 16 deletions docs/docs-content/clusters/edge/networking/connect-wifi.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ sidebar_position: 30
tags: ["edge"]
---

This how-to walks you through how to connect an Edge host to a wifi network with wpa_supplicant, using Intel NUCs as an
example. An Intel NUC is a mini PC that can be used as an Edge host for Palette Edge. You can apply the steps in this
how-to with Edge hosts running other hardware, but configuring the network interface might be be different on other
hardware.
This how-to walks you through how to connect an Edge host to a wifi network with
[wpa_supplicant](https://wiki.archlinux.org/title/wpa_supplicant), using Intel NUCs as an example. An Intel NUC is a
mini PC that can be used as an Edge host for Palette Edge. You can apply the steps in this how-to with other hardware,
but steps for configuring the network interface might be be different.

To connect an Edge host to wifi using wpa_supplicant, you need to download wpa_supplicant and provide the wifi
credentials to the Edge host. Depending on how Edge devices are managed at an organization, these two steps are often
done by different teams. If they are being done by the same team or person, you can merge the user-data in the step
[Supply Site-Specific User Data](#supply-site-specific-user-data) with the original user data you use to build Edge
artifacts and skip that step.
To connect an Edge host to wifi using `wpa_supplicant`, you need to build `wpa_supplicant` into the OS image used for
the Edge host and provide the wifi credentials to the Edge host. Depending on how Edge devices are managed at an
organization, these two steps are often done by different teams. If they are being done by the same team or person, you
can merge the user-data in the step [Supply Site-Specific User Data](#supply-site-specific-user-data) with the original
user data you use to build Edge artifacts and skip that step.

## Build OS Image with wpa_supplicant Included

Expand Down Expand Up @@ -46,7 +46,8 @@ artifacts and skip that step.
lines.

```
RUN apt-get update && apt-get install wpasupplicant
RUN apt-get update && apt-get install wpasupplicant && \
mkdir /var/lib/wpa
```

:::tip
Expand All @@ -58,7 +59,8 @@ artifacts and skip that step.
```
RUN apt-get update && apt-get install wpasupplicant -y && \
apt-get update && apt-get install network-manager -y && \
apt-get install iputils-ping -y
apt-get install iputils-ping -y && \
mkdir /var/lib/wpa
```

:::
Expand Down Expand Up @@ -93,14 +95,13 @@ instead.
### Procedure

1. Create a file named `user-data`, and include the following content. Replace `network-name` and `network-password`
with the name and password of your Wifi network. If your base image is not Ubuntu, replace the bind mount path with
another bound path.
with the name and password of your Wifi network.

```yaml
#cloud-config
install:
bind_mounts:
- /var/lib/ubuntu-advantage
- /var/lib/wpa

stages:
network.before:
Expand All @@ -119,8 +120,8 @@ instead.

# Check if a wireless interface was found and connect it to WiFi
if [ -n "$wireless_interface" ]; then
wpa_passphrase <network-name> <network-password> | tee /var/lib/ubuntu-advantage/wpa_supplicant.conf
wpa_supplicant -B -c /var/lib/ubuntu-advantage/wpa_supplicant.conf -i $wireless_interface
wpa_passphrase <network-name> <network-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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,83 @@ to a bootable device, such as a USB stick.

- `mkisofs`, or `genisoimage`, or similar ISO management software.

- `cdrtools` or `wodim` for Windows.
- `cdrtools` or `wodim` for Windows.

## Create ISO

1. Create a file called **user-data** that contains the additional configurations you want to override or inject.
1. 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](../../edgeforge-workflow/palette-canvos.md) step.

<br />
```shell
touch user-data
```

```shell
touch user-data
```
For example, you can include the following content in the **user-data** file to connect your Edge host to wifi. This
requires wpa_supplicant to be included in your base OS image. For more information, refer to
[Connect Intel NUC Edge Host to Wifi](../../networking/connect-wifi.md).

2. Create an empty **meta-data** file:
```yaml
#cloud-config
install:
bind_mounts:
- /var/lib/wpa
<br />
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
```shell
touch meta-data
```
# Check if a wireless interface was found and connect it to WiFi
if [ -n "$wireless_interface" ]; then
wpa_passphrase Madrid supersup | 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
```

3. Create an ISO using the following command.
2. Create an empty **meta-data** file:

MacOS/Linux:
```shell
touch meta-data
```

```shell
mkisofs -output site-user-data.iso -volid cidata -joliet -rock user-data meta-data
```
3. Create an ISO using the following command.

Windows:
<Tabs>
<TabItem label="macOS/Linux" value="mac-linux">

```shell
genisoimage -output site-user-data.iso -volid cidata -joliet -rock user-data meta-data
```
```shell
mkisofs -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. <br />
</TabItem>

4. Copy the ISO to a bootable device such as a USB drive.
<TabItem label="Windows" value="windows">

<br />
```shell
genisoimage -output site-user-data.iso -volid cidata -joliet -rock user-data meta-data
```

</TabItem>
</Tabs>

This generates an ISO file called **site-user-data.iso** in the current directory.

4. Flash your bootable device such as a USB drive with the ISO file you just created.

:::info

Expand All @@ -72,13 +110,16 @@ This generates an ISO file called site-user-data.iso in the current directory. <
5. 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.

<br />

## 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
Expand Down
66 changes: 33 additions & 33 deletions src/components/IconMapper/dynamicFontAwesomeImports.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import { faCubes } from "@fortawesome/free-solid-svg-icons";
import { faPersonWalkingLuggage } from "@fortawesome/free-solid-svg-icons";
import { faObjectGroup } from "@fortawesome/free-solid-svg-icons";
import { faEnvelopeOpenText } from "@fortawesome/free-solid-svg-icons";
import { faDatabase } from "@fortawesome/free-solid-svg-icons";
import { faHdd } from "@fortawesome/free-solid-svg-icons";
import { faCloudArrowDown } from "@fortawesome/free-solid-svg-icons";
import { faServer } from "@fortawesome/free-solid-svg-icons";
import { faUserShield } from "@fortawesome/free-solid-svg-icons";
import { faUsers } from "@fortawesome/free-solid-svg-icons";
import { faWarehouse } from "@fortawesome/free-solid-svg-icons";
import { faBook } from "@fortawesome/free-solid-svg-icons";
import { faBookmark } from "@fortawesome/free-solid-svg-icons";
import { faGavel } from "@fortawesome/free-solid-svg-icons";
import { faTerminal } from "@fortawesome/free-solid-svg-icons";
import { faLock } from "@fortawesome/free-solid-svg-icons";
import { faGears } from "@fortawesome/free-solid-svg-icons";
import { faScrewdriverWrench } from "@fortawesome/free-solid-svg-icons";
import { faShield } from "@fortawesome/free-solid-svg-icons";
import { faCubes } from '@fortawesome/free-solid-svg-icons';
import { faPersonWalkingLuggage } from '@fortawesome/free-solid-svg-icons';
import { faObjectGroup } from '@fortawesome/free-solid-svg-icons';
import { faEnvelopeOpenText } from '@fortawesome/free-solid-svg-icons';
import { faDatabase } from '@fortawesome/free-solid-svg-icons';
import { faHdd } from '@fortawesome/free-solid-svg-icons';
import { faCloudArrowDown } from '@fortawesome/free-solid-svg-icons';
import { faServer } from '@fortawesome/free-solid-svg-icons';
import { faUserShield } from '@fortawesome/free-solid-svg-icons';
import { faUsers } from '@fortawesome/free-solid-svg-icons';
import { faWarehouse } from '@fortawesome/free-solid-svg-icons';
import { faBook } from '@fortawesome/free-solid-svg-icons';
import { faBookmark } from '@fortawesome/free-solid-svg-icons';
import { faGavel } from '@fortawesome/free-solid-svg-icons';
import { faTerminal } from '@fortawesome/free-solid-svg-icons';
import { faLock } from '@fortawesome/free-solid-svg-icons';
import { faGears } from '@fortawesome/free-solid-svg-icons';
import { faScrewdriverWrench } from '@fortawesome/free-solid-svg-icons';
import { faShield } from '@fortawesome/free-solid-svg-icons';

export const fontAwesomeIcons = {
cubes: faCubes,
"cubes": faCubes,
"person-walking-luggage": faPersonWalkingLuggage,
"object-group": faObjectGroup,
"envelope-open-text": faEnvelopeOpenText,
database: faDatabase,
hdd: faHdd,
"database": faDatabase,
"hdd": faHdd,
"cloud-arrow-down": faCloudArrowDown,
server: faServer,
"server": faServer,
"user-shield": faUserShield,
users: faUsers,
warehouse: faWarehouse,
book: faBook,
bookmark: faBookmark,
gavel: faGavel,
terminal: faTerminal,
lock: faLock,
gears: faGears,
"users": faUsers,
"warehouse": faWarehouse,
"book": faBook,
"bookmark": faBookmark,
"gavel": faGavel,
"terminal": faTerminal,
"lock": faLock,
"gears": faGears,
"screwdriver-wrench": faScrewdriverWrench,
shield: faShield,
};
"shield": faShield
};

0 comments on commit cd31974

Please sign in to comment.