Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin bootc versions #599

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
bb69924
updated image
myee111 Dec 3, 2024
cf27f7d
instruqt metadata updates
myee111 Dec 3, 2024
0982378
removed setup cruft
myee111 Dec 3, 2024
3c1f894
put track in maintenance mode
myee111 Dec 3, 2024
886e50f
checksum
myee111 Dec 3, 2024
e2097b2
track metadata updates
myee111 Dec 3, 2024
f7a7de8
removed extra sleep
myee111 Dec 3, 2024
36a41a3
Updated
myee111 Dec 3, 2024
02fe3d2
Merge branch 'master' into myee111/issue569
myee111 Dec 3, 2024
ac20c41
Merge pull request #580 from rhel-labs:myee111/issue569
myee111 Dec 3, 2024
74f12c3
in-place-upgrades-9
myee111 Dec 3, 2024
82333e0
fixed a typo
myee111 Dec 3, 2024
afe3a36
change image
myee111 Dec 4, 2024
eabf530
Merge pull request #581 from rhel-labs:change-image-for-imagebuilder-…
myee111 Dec 4, 2024
d8ea40a
image update
myee111 Dec 4, 2024
0a2e6fb
checksum
myee111 Dec 4, 2024
7a0e610
Merge pull request #583 from rhel-labs:fix-the-image-convert2rhel
myee111 Dec 4, 2024
6716e12
instruqt metadata update
myee111 Dec 4, 2024
aee305a
i don't know why this lab uses a virt image. updated to 9.5
myee111 Dec 4, 2024
98882e5
Merge pull request #584 from rhel-labs:myee111/issue566
myee111 Dec 4, 2024
a8cc46f
instruqt metadata update
myee111 Dec 4, 2024
1ae007c
reduced setup cruft
myee111 Dec 4, 2024
67349ee
Merge pull request #585 from rhel-labs:myee111/issue568
myee111 Dec 4, 2024
5e79611
changed image
myee111 Dec 4, 2024
fbee1aa
instruqt metadata update
myee111 Dec 4, 2024
5fcabf6
updates so far
myee111 Dec 4, 2024
06e2c8d
maintenance mode
myee111 Dec 4, 2024
8ee8dde
checksum
myee111 Dec 5, 2024
5beb6f6
Merge pull request #586 from rhel-labs:myee111/issue564
myee111 Dec 5, 2024
b191755
took rhel system roles firewall out of maintenance
myee111 Dec 5, 2024
493e4a8
Update README.md
myee111 Dec 5, 2024
96253ce
Update README.md
myee111 Dec 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,10 @@ Learn about how you can obtain a free Red Hat Enterprise Linux subscription here
Documentation for this repository is stored in the wiki section here:
[https://github.com/rhel-labs/instruqt/wiki](https://github.com/rhel-labs/instruqt/wiki)

## Helper Script

This script is used for making bulk changes to the labs like modifying all the VM images.

<https://github.com/rhel-labs/instruqt-update-helper>

## Red Hat Internal Documentation

[Google Doc](https://docs.google.com/document/d/1WozkbDSJD7L850HAfIrQw7ifXuJlm-hDzU7-CCe6S7Q/edit#heading=h.pi65ypczlg9y)

## Requests for new labs, bugs

To request new features, labs, or to report bugs, please create a new issue.

## Current VM images

RHEL 9.2
image: `projects/tmm-instruqt-11-26-2021/global/images/rhel-9-2-6-20-23`

RHEL 9.2 with virt
image: `projects/tmm-instruqt-11-26-2021/global/images/virt-rhel-9-2-08-01-23`
[List of images here](https://github.com/rhel-labs/instruqt/wiki/images).
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ In the search bar, enter the following.
rhel tasks
```

2) Click on `RHEL Tasks`
2) Click on `Tasks | RHEL`

![](../assets/tasksnew.png)

Expand Down Expand Up @@ -174,6 +174,13 @@ tail -f /var/log/convert2rhel/convert2rhel.log
```
![tail logs](../assets/viewlogs.png)

> [!WARNING]
> The `tail -f /var/log/convert2rhel/convert2rhel.log` may result in the following error below because there may be a delay between the previous operation to run the pre-conversion analysis and your centos host running the task.
> ```
> tail: cannot open ‘/var/log/convert2rhel/convert2rhel.log’ for reading: No such file or directory
> tail: no files remaining
> ```

To view the status of the task in Insights, click on the `Activity` tab.

![activity tab](../assets/activitytab.png)
Expand Down
2 changes: 1 addition & 1 deletion centos-conversion-insights/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ virtualbrowsers:
url: https://console.redhat.com
virtualmachines:
- name: host
image: projects/tmm-instruqt-11-26-2021/global/images/virt-rhel-9-5-11-26-24
image: projects/tmm-instruqt-11-26-2021/global/images/virt-rhel-9-5-11-29-24
shell: /bin/bash
environment:
TERM: xterm
Expand Down
3 changes: 2 additions & 1 deletion centos-conversion-insights/track.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ lab_config:
feedback_recap_enabled: true
feedback_tab_enabled: false
loadingMessages: true
override_challenge_layout: false
hideStopButton: false
default_layout: AssignmentRight
default_layout_sidebar_size: 33
checksum: "3400256481407639150"
checksum: "12471132800590439347"
enhanced_loading: false
29 changes: 6 additions & 23 deletions centos-conversion-insights/track_scripts/setup-host
Original file line number Diff line number Diff line change
@@ -1,40 +1,23 @@
#!/bin/bash
while [ ! -f /opt/instruqt/bootstrap/host-bootstrap-completed ]
do
echo "Waiting for Instruqt to finish booting the VM"
sleep 1
done

virsh start centos

subscription-manager config --rhsm.manage_repos=1
subscription-manager register --activationkey=${ACTIVATION_KEY} --org=12451665 --force
agent variable set sandboxid $_SANDBOX_ID

usermod -aG wheel rhel
echo redhat | passwd --stdin rhel
virsh start centos

echo "${SSHKEY}" > /root/.ssh/id_rsa
chmod 600 /root/.ssh/id_rsa
ssh-keygen -f /root/.ssh/id_rsa -y > /root/.ssh/id_rsa.pub

# MAC Addresses
# vm1: 52:54:00:d6:0c:72
# centos: 52:54:00:68:79:84
# converted: 52:54:00:87:d3:fc
# rhel07: 52:54:00:02:ce:bb
# rhel08: 52:54:00:43:26:d3
# rhel09: 52:54:00:7f:e1:4e
# upgraded08: 52:54:00:22:37:93
# upgraded09: 52:54:00:e6:14:ee

# Get the IP of the VM belonging to cento based on arp.
while ! [ $( arp -an | grep 52:54:00:68:79:84 | awk '{print $2}' | tr -d '()' ) ]; do echo "Waiting for arp to return centos MAC address."; sleep 10; done;
echo "$( arp -an | grep 52:54:00:68:79:84 | awk '{print $2}' | tr -d '()' ) centos" >> /etc/hosts
# This sleep call is to give libvirt-nss time to find the ip address of the vm.
sleep 30

agent variable set sandboxid $_SANDBOX_ID
# Attempt to register the vm 3 times, waiting 30 seconds for each attempt.
#(r=3;while ! ssh -i /root/.ssh/id_rsa -o "StrictHostKeyChecking no" centos "subscription-manager register --activationkey=${ACTIVATION_KEY} --org=12451665 --force" ; do ((--r))||exit;sleep 30;done)

# Set centos hostname and pass it as a runtime variable.
while ! ping -c 1 -W 1 centos; do echo "Waiting for centos - network interface might be down."; sleep 10; done;
centosid="centos-conversion-$(uuidgen | cut -c 32-)"
agent variable set vmid "$centosid"
ssh -o "StrictHostKeyChecking no" root@centos hostnamectl set-hostname "$centosid"
Expand Down
2 changes: 1 addition & 1 deletion convert2rhel/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
virtualmachines:
- name: host
image: projects/tmm-instruqt-11-26-2021/global/images/virt-rhel-9-5-11-26-24
image: projects/tmm-instruqt-11-26-2021/global/images/virt-rhel-9-5-11-29-24
shell: /bin/bash
environment:
TERM: xterm
Expand Down
5 changes: 2 additions & 3 deletions convert2rhel/track.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ tags:
- conversions
owner: rhel
developers:
- [email protected]
- [email protected]
maintenance: true
- [email protected]
show_timer: true
timelimit: 3600
lab_config:
Expand All @@ -40,5 +39,5 @@ lab_config:
hideStopButton: false
default_layout: AssignmentRight
default_layout_sidebar_size: 33
checksum: "3667878121716427374"
checksum: "10662381237094973691"
enhanced_loading: false
23 changes: 6 additions & 17 deletions convert2rhel/track_scripts/setup-host
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,16 @@ do
sleep 1
done

agent variable set sandboxid $_SANDBOX_ID

virsh start centos

echo "${SSHKEY}" > /root/.ssh/id_rsa
chmod 600 /root/.ssh/id_rsa
ssh-keygen -f /root/.ssh/id_rsa -y > /root/.ssh/id_rsa.pub

usermod -aG wheel rhel

# MAC Addresses
# vm1: 52:54:00:d6:0c:72
# centos: 52:54:00:68:79:84
# rhel07: 52:54:00:02:ce:bb
# rhel08: 52:54:00:43:26:d3
# rhel09: 52:54:00:7f:e1:4e


# Get the IP of the VM belonging to vm1 based on arp.
while ! [ $( arp -an | grep 52:54:00:68:79:84 | awk '{print $2}' | tr -d '()' ) ]; do echo "Waiting for arp to return centos MAC address."; sleep 10; done;
echo "$( arp -an | grep 52:54:00:68:79:84 | awk '{print $2}' | tr -d '()' ) centos" >> /etc/hosts

usermod -aG wheel rhel
echo redhat | passwd --stdin rhel
# This sleep call is to give libvirt-nss time to find the ip address of the vm.
sleep 30

while ! ping -c 1 -W 1 centos; do echo "Waiting for centos - network interface might be down."; sleep 10; done;
# Attempt to register the vm 3 times, waiting 30 seconds for each attempt.
#(r=3;while ! ssh -i /root/.ssh/id_rsa -o "StrictHostKeyChecking no" centos "subscription-manager register --activationkey=${ACTIVATION_KEY} --org=12451665 --force" ; do ((--r))||exit;sleep 30;done)
18 changes: 10 additions & 8 deletions firewall-system-role/01-introduction/assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,38 @@ tabs:
title: controlnode
type: terminal
hostname: controlnode
cmd: tmux attach-session -t "firewall-testing"
- id: yapmn6f1xgcj
title: rhelvm
title: vm1
type: terminal
hostname: controlnode
cmd: tmux attach-session -t "firewall-testing-rhelvm"
cmd: ssh -i /root/.ssh/id_rsa -o "StrictHostKeyChecking no" root@vm1
- id: 3nmln4oousqe
title: controlnode Web Console
type: external
url: https://controlnode.${_SANDBOX_ID}.instruqt.io:9090
difficulty: basic
timelimit: 3000
lab_config:
custom_layout: '{"root":{"children":[{"branch":{"size":66,"children":[{"leaf":{"tabs":["d2teuijqhcov","3nmln4oousqe"],"activeTabId":"d2teuijqhcov","size":49}},{"leaf":{"tabs":["yapmn6f1xgcj"],"activeTabId":"yapmn6f1xgcj","size":49}}]}},{"leaf":{"tabs":["assignment"],"activeTabId":"assignment","size":33}}],"orientation":"Horizontal"}}'
enhanced_loading: null
---

> _NOTE:_ To make the inline images larger, expand this window. ![Menu Slider](../assets/slider.png)

This lab is composed of two hosts.

1. controlnode
2. rhelvm
2. vm1

In this lab, we will use the host `controlnode` as the "control node" or the node where we will install and run the firewall system role. Firewall changes will be applied to `rhelvm`.
In this lab, we will use the host `controlnode` as the "control node" or the node where we will install and run the firewall system role. Firewall changes will be applied to `vm1`.

We'll perform the following 3 tasks.

1. We will use the firewall system role to open the appropriate port to access web servers on `rhelvm`. This exercise is to show how to open firewall ports by service.
1. We will use the firewall system role to open the appropriate port to access web servers on `vm1`. This exercise is to show how to open firewall ports by service.

2. As well, we will also use the firewall system role to open port 9999 on `rhelvm` to enable inbound tcp connections. This exercise is to show how to open an arbitrary firewall port.
2. As well, we will also use the firewall system role to open port 9999 on `vm1` to enable inbound tcp connections. This exercise is to show how to open an arbitrary firewall port.

3. Finally, we'll configure port forwarding from 9999 to port 12345 on `rhelvm`.
3. Finally, we'll configure port forwarding from 9999 to port 12345 on `vm1`.

![afterapplying](../assets/firewallsystemrolesoverview.png)

Expand Down
11 changes: 8 additions & 3 deletions firewall-system-role/02-installsystemroles/assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ tabs:
title: controlnode
type: terminal
hostname: controlnode
cmd: tmux attach-session -t "firewall-testing"
- id: xjo3jxzqs5od
title: rhelvm
title: vm1
type: terminal
hostname: controlnode
cmd: tmux attach-session -t "firewall-testing-rhelvm"
cmd: ssh -i /root/.ssh/id_rsa -o "StrictHostKeyChecking no" root@vm1
- id: dl1pzm38ev9g
title: controlnode Web Console
type: external
url: https://controlnode.${_SANDBOX_ID}.instruqt.io:9090
difficulty: basic
timelimit: 1
lab_config:
custom_layout: '{"root":{"children":[{"branch":{"size":66,"children":[{"leaf":{"tabs":["fawzh4mfupxy","dl1pzm38ev9g"],"activeTabId":"fawzh4mfupxy","size":49}},{"leaf":{"tabs":["xjo3jxzqs5od"],"activeTabId":"xjo3jxzqs5od","size":49}}]}},{"leaf":{"tabs":["assignment"],"activeTabId":"assignment","size":33}}],"orientation":"Horizontal"}}'
enhanced_loading: null
---

Now we'll install system roles.
Expand All @@ -37,6 +39,9 @@ Enter the following command.
```bash,run
dnf install rhel-system-roles -y
```
> [!NOTE]
> You can click on the `run` button and select the terminal where you wish to run the command.
> ![](../assets/runbutton.png)

The resulting output will look similar to the output below.

Expand Down
46 changes: 24 additions & 22 deletions firewall-system-role/03-openhttpservice/assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,29 @@ tabs:
title: controlnode
type: terminal
hostname: controlnode
cmd: tmux attach-session -t "firewall-testing"
- id: jjy6ddnfvsfb
title: rhelvm
title: vm1
type: terminal
hostname: controlnode
cmd: tmux attach-session -t "firewall-testing-rhelvm"
cmd: ssh -i /root/.ssh/id_rsa -o "StrictHostKeyChecking no" root@vm1
- id: 5tlhuxjaynsa
title: controlnode Web Console
type: external
url: https://controlnode.${_SANDBOX_ID}.instruqt.io:9090
difficulty: basic
timelimit: 1
lab_config:
custom_layout: '{"root":{"children":[{"branch":{"size":66,"children":[{"leaf":{"tabs":["aja3vlwfhadg","5tlhuxjaynsa"],"activeTabId":"aja3vlwfhadg","size":49}},{"leaf":{"tabs":["jjy6ddnfvsfb"],"activeTabId":"jjy6ddnfvsfb","size":49}}]}},{"leaf":{"tabs":["assignment"],"activeTabId":"assignment","size":33}}],"orientation":"Horizontal"}}'
enhanced_loading: null
---

In this challenge, we will enable access to the http port 80 on `rhelvm`.
In this challenge, we will enable access to the http port 80 on `vm1`.

First, we'll prove to ourselves that port 80 is blocked by the firewall running on `rhelvm`.
First, we'll prove to ourselves that port 80 is blocked by the firewall running on `vm1`.

Switch to the [button label="rhelvm"](tab-1) terminal by clicking on this button: [button label="rhelvm"](tab-1).
Switch to the [button label="vm1"](tab-1) terminal by clicking on this button: [button label="vm1"](tab-1).

Run the following in [button label="rhelvm"](tab-1).
Run the following in [button label="vm1"](tab-1).

```bash,run
firewall-cmd --list-all
Expand All @@ -43,39 +45,39 @@ firewall-cmd --list-all

The output above shows that port 80 is not open.

In the `rhelvm` terminal, run `nc -l 80`. This command runs the utility `netcat` and tells it to listen for incoming traffic on port 80.
In the `vm1` terminal, run `nc -l 80`. This command runs the utility `netcat` and tells it to listen for incoming traffic on port 80.

```bash,run
nc -l 80
```

![nclistening](../assets/nclistening.png)

`netcat` is now listening on port 80 on `rhelvm`.
`netcat` is now listening on port 80 on `vm1`.

> [!WARNING]
> Do not exit out of `nc` in this terminal!

Switch back to the [button label="controlnode"](tab-0) terminal.

Enter the command `nc rhelvm 80`. This tells `netcat` to connect to port 80 on `rhelvm`.
Enter the command `nc vm1 80`. This tells `netcat` to connect to port 80 on `vm1`.

```bash,run
nc rhelvm 80
nc vm1 80
```

![noroute](../assets/no-route.png)

`netcat` cannot connect to `rhelvm` on port 80.
`netcat` cannot connect to `vm1` on port 80.

Let's use RHEL systems roles to open up port 80 on `rhelvm`.
Let's use RHEL systems roles to open up port 80 on `vm1`.

First, Ansible requires a host file pointing at the `rhelvm` host. The host file looks like this.
First, Ansible requires a host file pointing at the `vm1` host. The host file looks like this.

<pre>
all:
hosts:
rhelvm:
vm1:
vars:
firewall:
- service: http
Expand All @@ -88,7 +90,7 @@ Copy and paste the following into the [button label="controlnode"](tab-0) termin
tee -a /root/hosts << EOF
all:
hosts:
rhelvm:
vm1:
vars:
firewall:
- service: http
Expand Down Expand Up @@ -116,27 +118,27 @@ tee -a /root/firewall.yml <<EOF
EOF
```

Now we'll apply the system role to `rhelvm` by running the following command on [button label="controlnode"](tab-0) .
Now we'll apply the system role to `vm1` by running the following command on [button label="controlnode"](tab-0) .

```bash,run
ansible-playbook -i hosts -b firewall.yml
```

![applysystemrole](../assets/applysystemrole.png)

Run `nc rhelvm 80` in the [button label="controlnode"](tab-0) terminal again.
Run `nc vm1 80` in the [button label="controlnode"](tab-0) terminal again.

```bash,run
nc rhelvm 80
nc vm1 80
```

We'll type something into the terminal and hit enter. You should see it printed out in the [button label="rhelvm"](tab-1) terminal.
We'll type something into the terminal and hit enter. You should see it printed out in the [button label="vm1"](tab-1) terminal.

![ncresult80](../assets/ncport80.png)

Exit out of `nc` in the [button label="controlnode"](tab-0) terminal by typing `ctrl-c`. This will cause `nc` to exit in [button label="rhelvm"](tab-1).
Exit out of `nc` in the [button label="controlnode"](tab-0) terminal by typing `ctrl-c`. This will cause `nc` to exit in [button label="vm1"](tab-1).

Finally, we'll use `firewall-cmd` to list the open ports on [button label="rhelvm"](tab-1). Switch to the [button label="rhelvm"](tab-1) terminal and run the following command.
Finally, we'll use `firewall-cmd` to list the open ports on [button label="vm1"](tab-1). Switch to the [button label="vm1"](tab-1) terminal and run the following command.

```bash,run
firewall-cmd --list-all
Expand Down
Loading