Skip to content

Commit

Permalink
Formatting changes, labelling,
Browse files Browse the repository at this point in the history
- Removed # from all commands. [source,sh,role=execute,subs="attributes"] copies to clipboard when command is clicked on.
- Renamed scenario headings.
- Removed "Start the lab" from all sections.
+ Changed to root # sudo -i
+ Created separate sections for commands and output.
+ Access the bastion node using the terminal window on the right, or using SSH.
  • Loading branch information
deplist authored Dec 19, 2024
1 parent f2de486 commit 95a8674
Showing 1 changed file with 72 additions and 44 deletions.
116 changes: 72 additions & 44 deletions content/modules/ROOT/pages/module-02.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ In this module, we will explore scenarios impacting connectivity between Red Hat
{empty} +

[#scenario 1]
== [Scenario 1]: Troubleshoot client registration errors
== Scenario 1: Troubleshoot client registration errors

The objective of this scenario is to investigate and resolve issues which prevents a client from registering with or accessing content from Red Hat Satellite.

=== Start the lab
Access the bastion node through the terminal on the right, or using SSH.

To begin the lab, access the bastion node using SSH in the terminal window.
Switch to root user.

[source,sh,role=execute,subs="attributes"]
----
# ssh root@{bastion_public_hostname}
sudo -i
----

Run the following command to introduce the registration failure
Run the following command to introduce the registration failure.

[source,sh,role=execute,subs="attributes"]
----
# lab break client_registration
lab break client_registration
----


Expand All @@ -48,14 +48,14 @@ Run the following command to introduce the registration failure

[source,sh,role=execute,subs="attributes"]
----
# ssh root@{node1_public_hostname}
ssh root@{node2_public_hostname}
----

* Display registration status. The command is expected to return a failure output.

[source,sh,role=execute,subs="attributes"]
----
# subscription-manager status
subscription-manager status
----

* Stop the stuck command by pressing Ctrl + C.
Expand All @@ -64,21 +64,25 @@ Run the following command to introduce the registration failure

[source,sh,role=execute,subs="attributes"]
----
# tail /var/log/rhsm/rhsm.log
tail /var/log/rhsm/rhsm.log
----

* Inspect the rhsm.conf file

[source,sh,role=execute,subs="attributes"]
----
# cat /etc/rhsm/rhsm.conf
cat /etc/rhsm/rhsm.conf
----

* We can see that custom proxy settings are in use.

[source,sh,role=execute,subs="attributes"]
----
# grep ^proxy /etc/rhsm/rhsm.conf
grep ^proxy /etc/rhsm/rhsm.conf
----

Output
----
proxy_hostname = proxy.example.com
proxy_scheme = http
proxy_port = 8080
Expand All @@ -88,31 +92,38 @@ Run the following command to introduce the registration failure

[source,sh,role=execute,subs="attributes"]
----
# subscription-manager config --server.proxy_hostname "" --server.proxy_port "" --server.proxy_user "" --server.proxy_password ""
subscription-manager config --server.proxy_hostname "" --server.proxy_port "" --server.proxy_user "" --server.proxy_password ""
----

* Edit the rhsm.conf file to replace the false hostname with the correct FQDN of the Satellite server.

[source,sh,role=execute,subs="attributes"]
----
# sed -i 's/hostname =.*/hostname = satellite.lab.example.com/' /etc/rhsm/rhsm.conf
# sed -i 's/baseurl =.*/baseurl = https://satellite.lab.example.com/pulp/content' /etc/rhsm/rhsm.conf
sed -i 's/hostname =.*/hostname = satellite.lab.example.com/' /etc/rhsm/rhsm.conf
----

----
sed -i 's/baseurl =.*/baseurl = https://satellite.lab.example.com/pulp/content' /etc/rhsm/rhsm.conf
----

* On the Satellite server, generate a Global Registration command (insecure option used to disable SSL validation)

[source,sh,role=execute,subs="attributes"]
----
# hammer host-registration generate-command \
hammer host-registration generate-command \
--activation-keys "My_Activation_Key" \
--insecure true
----

* Paste the registration command on Node 2. The command is expected to fail with error
* Paste the registration command on Node 2. Note: Do not copy this command, use the command generated by Satellite
The registration is expected to fail with error.

[source,sh,role=execute,subs="attributes"]
----
# set -o pipefail && curl -sS --insecure 'https://satellite.example.com/register?activation_keys=GENERAL&force=1&location_id=2&organization_id=1&setup_insights=0&setup_remote_execution=1&setup_remote_execution_pull=0' -H 'Authorization: Bearer TOKEN' | bash
set -o pipefail && curl -sS --insecure 'https://satellite.example.com/register?activation_keys=GENERAL&force=1&location_id=2&organization_id=1&setup_insights=0&setup_remote_execution=1&setup_remote_execution_pull=0' -H 'Authorization: Bearer TOKEN' | bash
----

Output:
----
# Running registration
#
This system is currently not registered.
Expand All @@ -123,10 +134,12 @@ Run the following command to introduce the registration failure

* Run the registration command. This time the registration is successful.

[source,sh,role=execute,subs="attributes"]
----
# set -o pipefail && curl -sS --insecure 'https://satellite.example.com/register?activation_keys=GENERAL&force=1&location_id=2&organization_id=1&setup_insights=0&setup_remote_execution=1&setup_remote_execution_pull=0' -H 'Authorization: Bearer TOKEN' | bash
#
set -o pipefail && curl -sS --insecure 'https://satellite.example.com/register?activation_keys=GENERAL&force=1&location_id=2&organization_id=1&setup_insights=0&setup_remote_execution=1&setup_remote_execution_pull=0' -H 'Authorization: Bearer TOKEN' | bash
----

Output:
----
# Running registration
#
subscription-manager is already installed!
Expand All @@ -138,7 +151,11 @@ The registered system name is: node2.lab.example.com

[source,sh,role=execute,subs="attributes"]
----
# subscription-manager status
subscription-manager status
----

Output:
----
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Expand All @@ -151,25 +168,25 @@ System Purpose Status: Disabled
{empty} +

[#scenario 2]
== [Scenario 2]: Troubleshoot Remote Execution
== Scenario 2: Troubleshoot Remote Execution

Running a remote execution job on a client fails.
The objective of this scenario is to investigate and remediate issues preventing remote execution of jobs.

=== Start the lab
Access the bastion node through the terminal on the right, or using SSH.

To begin the lab, access the bastion node using SSH in the terminal window.
Switch to root user.

[source,sh,role=execute,subs="attributes"]
----
# ssh root@{bastion_public_hostname}
sudo -i
----

Run the following command to introduce the remote execution failure
Run the following command to introduce remote execution failure.

[source,sh,role=execute,subs="attributes"]
----
# lab break client_execution
lab break client_execution
----


Expand All @@ -188,7 +205,7 @@ Run the following command to introduce the remote execution failure

[source,sh,role=execute,subs="attributes"]
----
# hammer settings set \
hammer settings set \
--name=remote_execution_fallback_proxy \
--value=true
----
Expand All @@ -198,66 +215,77 @@ Run the following command to introduce the remote execution failure
{empty} +

[#scenario 3]
== [Scenario 3]: Troubleshoot Capsule Connectivity
== Scenario 3: Troubleshoot Capsule Connectivity

The objective of this scenario is to investigate and remediate issues affecting connectivity between clients and Red Hat Satellite Capsule.

Access the bastion node through the terminal on the right, or using SSH.

=== Start the lab

To begin the lab, access the bastion node using SSH in the terminal window.
Switch to root user.

[source,sh,role=execute,subs="attributes"]
----
# ssh root@{bastion_public_hostname}
sudo -i
----

Run the following command to introduce the registration failure

[source,sh,role=execute,subs="attributes"]
----
# lab break client_capsule
lab break client_capsule
----


=== [WIP] Issue: Capsule connectivity
=== Issueue: Capsule connectivity

* On Node 2, (already registered to Capsule), display the registration status.

[source,sh,role=execute,subs="attributes"]
----
# subscription-manager status
subscription-manager status
----

* Try installing a package. Package installation is expected to fail.

[source,sh,role=execute,subs="attributes"]
----
# dnf install bash-completion
dnf install bash-completion
----

* On the Capsule, test network ports.

[source,sh,role=execute,subs="attributes"]
----
# nc -v mysatellite.example.com 443
# nc -v mysatellite.example.com 5646
# nc -v mysatellite.example.com 5647
nc -v mysatellite.example.com 443
----

[source,sh,role=execute,subs="attributes"]
----
nc -v mysatellite.example.com 5646
----

[source,sh,role=execute,subs="attributes"]
----
nc -v mysatellite.example.com 5647
----

* On the Satellite server, check the responsiveness of core services.

[source,sh,role=execute,subs="attributes"]
----
# hammer ping
hammer ping
----

* On the Satellite server, check certificate exchange with Capsule. Expected to fail.

[source,sh,role=execute,subs="attributes"]
----
# curl -v https://capsule.lab.example.com/pulp/api/v2/status/ | python -m json.tool
# curl --cert /etc/foreman/client_cert.pem --key /etc/foreman/client_key.pem --cacert /etc/foreman/proxy_ca.pem https://capsule.lab.example.com:9090/features | python3 -m json.tool
curl -v https://capsule.lab.example.com/pulp/api/v2/status/ | python -m json.tool
----

[source,sh,role=execute,subs="attributes"]
----
curl --cert /etc/foreman/client_cert.pem --key /etc/foreman/client_key.pem --cacert /etc/foreman/proxy_ca.pem https://capsule.lab.example.com:9090/features | python3 -m json.tool
----

Cause: A firewall or proxy, which is located between the Satellite and Capsule servers, is making a certificate modification during the certification validation process. It needs to be checked and corrected.

0 comments on commit 95a8674

Please sign in to comment.