Skip to content

Commit 2877534

Browse files
authored
docs(migrations): add clarity to migration docs (#378)
* docs(migrations): add clarity to migration docs * docs(salt): update the key and repo added to be dynamic
1 parent 727f4c6 commit 2877534

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

docs/guides/migration-recipe.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,19 @@ index 68387c9..7a8ace1 100644
8989
```console
9090
9191
```
92-
2. Add Salt repositories for our current target version (add the apt-repo and install `salt-minion` package)
93-
```console
94-
# Add the SaltStack repository key
95-
wget --quiet -O /usr/share/keyrings/salt-archive-keyring.gpg https://repo.saltproject.io/py3/ubuntu/20.04/$(dpkg --print-architecture)/3004/salt-archive-keyring.gpg
96-
# Add the SaltStack repository
97-
echo "deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=$(dpkg --print-architecture)] https://repo.saltproject.io/py3/ubuntu/20.04/$(dpkg --print-architecture)/3004 focal main" > /etc/apt/sources.list.d/salt.list
92+
2. Add Salt repositories for our current target version (add the apt-repo and install `salt-minion` package):
93+
> **Note**: Ensure you are adding the correct key/repository for the version of Ubuntu you are using.
94+
>
95+
> See [the Salt installation guide](https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/ubuntu.html) for more information.
96+
```console
97+
UBUNTU_VERSION=$(lsb_release -rs)
98+
ARCH=$(dpkg --print-architecture)
99+
CODENAME=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d '=' -f 2)
100+
101+
echo "Adding the SaltStack repository key for $UBUNTU_VERSION $CODENAME ($ARCH)..."
102+
sudo curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring-2023.gpg https://repo.saltproject.io/salt/py3/ubuntu/$UBUNTU_VERSION/$ARCH/SALT-PROJECT-GPG-PUBKEY-2023.gpg
103+
echo "Adding the SaltStack repository for $UBUNTU_VERSION $CODENAME ($ARCH)..."
104+
echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=$ARCH] https://repo.saltproject.io/salt/py3/ubuntu/$UBUNTU_VERSION/$ARCH/latest $CODENAME main" | sudo tee /etc/apt/sources.list.d/salt.list
98105
```
99106
3. Install and configure the salt-minion. On `$new-host`, run the command
100107
```console
@@ -105,15 +112,16 @@ index 68387c9..7a8ace1 100644
105112
```console
106113
for file in /etc/salt/minion.d/*; do echo -e "cat > $file <<EOF"; sudo cat $file; echo "EOF"; done
107114
```
108-
4. Restart the salt-minion service on the new host to pick up the configuration and register with salt-master:
115+
- Copy and paste the generated commands to create and populate the files on `new-host`
116+
4. Restart the `salt-minion` service on the **new host** to pick up the configuration and register with salt-master:
109117
```console
110118
sudo salt-call service.restart
111119
```
112-
5. On salt-master, accept the key for the new-host:
120+
5. On **`salt-master`**, accept the key for the new-host:
113121
```console
114122
sudo salt-key -a new-host
115123
```
116-
6. On the new-host, run `highstate`:
124+
6. On the **`new-host`**, run `highstate`:
117125
```console
118126
sudo salt-call state.highstate
119127
```
@@ -123,7 +131,7 @@ index 68387c9..7a8ace1 100644
123131
ssh -L 4646:127.0.0.1:4646 lb-a.nyc1.psf.io
124132
```
125133
- Then view the `haproxy` status page in your browser [`http://localhost:4646/haproxy?stats`][loadbalancer]
126-
9. Run `hightstate` on the salt-master to create a public dns record for the new-host
134+
9. Run `hightstate` on the `salt-master` to create a public dns record for the new host
127135
```console
128136
sudo salt-call state.highstate
129137
```

0 commit comments

Comments
 (0)