Skip to content

Commit

Permalink
Merge pull request #2193 from heatmiser/rhdp_auto_satellite-exercises…
Browse files Browse the repository at this point in the history
…-2024-10-21.01

rhdp_auto_satellite exercise edits 2024-10-21.01
  • Loading branch information
IPvSean authored Oct 30, 2024
2 parents 4e9f407 + e24f44a commit 662dda8
Show file tree
Hide file tree
Showing 37 changed files with 606 additions and 368 deletions.
46 changes: 45 additions & 1 deletion exercises/rhdp_auto_satellite/3-convert2rhel/1.1-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,51 @@ The AAP Web UI is where we will go to submit and check the status of the Ansible

![Example AAP Web UI dashboard](images/aap_console_example.svg)

- We will learn more about how to use the AAP Web UI in the next exercise.
- Let's use the AAP Web UI to make a couple of preparations for the exercise. First, let's ensure our CentOS nodes are up and running. In the AAP Web UI browser tab, navigate to Resources > Templates by clicking on "Templates" under the "Resources" group in the navigation menu. Browse the list of job templates and click on the template `EC2 / Instance action`:

![Job templates filtered list](images/instance_action_01.png)

- Review the job details and then click on `Launch`:

![Job templates filtered list](images/instance_action_details_01.png)

- Review the job variables prompt and then click `Next`:

![Job templates filtered list](images/instance_action_survey_01.png)

- For `Select EC2 instance action` choose `start` from the drop down menu. For `Select OS target` choose `CentOS7` from the drop down. Finally, for `Select Environment stage` choose `Dev` from the drop selection. Once the survey selections have been completed, click `Next`:

![Job templates filtered list](images/instance_action_details_01.png)

- Review the preview job dialog then click `Launch`:

![Job templates filtered list](images/instance_action_preview_01.png)

- Verify that the job run is successful via the job output:

![Job templates filtered list](images/instance_action_job_output_01.png)

Additionally, we need to run some automation to make some final adjustments to the environment for the CentOS to RHEL conversion.

- In the AAP Web UI browser tab, navigate to Resources > Templates by clicking on "Templates" under the "Resources" group in the navigation menu. Browse the list of job templates and click on the ![launch](images/convert2rhel-aap2-launch.png) icon to the right of `Z / CaC / Controller / C2R - RIPU scenario`:

![Job templates filtered list](images/controller_cac_centos7_c2r.png)

- Review the job variables prompt and then click `Next`:

![Job templates filtered list](images/controller_cac_centos7_c2r_vars.png)

- On the survey dialog, for `Choose C2R/RIPU version to prepare on Controller` choose `CentOS7_C2R` from the drop down menu. then click `Next`:

![Job templates filtered list](images/controller_cac_centos7_c2r_survey.png)

- Review the preview job dialog then click `Launch`:

![Job templates filtered list](images/controller_cac_centos7_c2r_preview.png)

- Verify that the job run is successful via the job output:

![Job templates filtered list](images/controller_cac_centos7_c2r_output.png)

### Step 2 - Access the Visual Studio Code Web UI

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ This use-case will focus on conversion from CentOS (though this could be another

![Controller inventories groups](images/update_controller_inventory_06.png)

- In the menu bar on the left, select "Inventories" --> "EC2 Dynamic Inventories". Once the **EC2 Dynamic Inventory** details screen is displayed, click on the "Groups" tab.
- In the menu bar on the left, select "Inventories" --> "EC2 Dynamic Inventory". Once the **EC2 Dynamic Inventory** details screen is displayed, click on the "Groups" tab.

![Controller inventories group](images/update_controller_inventory_07.png)

Expand Down
79 changes: 67 additions & 12 deletions exercises/rhdp_auto_satellite/3-convert2rhel/1.3-analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
- [Commit](#commit)
- [Let's Get Started](#lets-get-started)
- [Step 2 - Patch OS to latest package versions](#step-2---patch-os-to-latest-package-versions)
- [Step 3 - Use AAP to Launch an Analysis Playbook Job](#step-3---use-aap-to-launch-an-analysis-playbook-job)
- [Step 4 - Review the Playbook Job Output](#step-3---review-the-playbook-job-output)
- [Step 5 - Challenge Lab: Analysis Playbook](#step-4---challenge-lab-analysis-playbook)
- [Step 3 - Change Content Source for Content Host](#step-3---change-content-source-for-content-host)
- [Step 4 - Use AAP to Launch an Analysis Playbook Job](#step-4---use-aap-to-launch-an-analysis-playbook-job)
- [Step 5 - Review the Playbook Job Output](#step-5---review-the-playbook-job-output)
- [Step 6 - Challenge Lab: Analysis Playbook](#step-6---challenge-lab-analysis-playbook)
- [Conclusion](#conclusion)

## Objectives
Expand Down Expand Up @@ -101,13 +102,65 @@ One of the prerequisites for successful Convert2RHEL OS conversions is that the

- With a successful job completion, we are ready to proceed with the pre-conversion OS analysis.

### Step 3 - Use AAP to Launch an Analysis Playbook Job
### Step 3 - Change Content Source for Content Host

Before we start the pre-conversion OS analysis, we need to change the Satellite content source for our CentOS content hosts. With the release of Convert2RHEL 2.x, providing content registration details as part of the variables supplied are no longer utilized. Instead, the system to be converted should be registered to a content view that provides access to package repositories for both the current version of installed operating system, as well as access to package repositories for the target version of RHEL that is being converted to. In addition, access to the Convert2RHEL related package repositories should be included.

If you would like to review the content view configuration that we will be utilizing as part of the conversion process, switch to the browser tab where you are logged in to Satellite.

- Once the Satellite web UI is accessible, click on Content > Lifecycle > Content Views.

![Satellite Content Views](images/satellite_content_views.png)

> **Note**
>
> A composite content view in Satellite is a content view that is composed of other composite views, typically multiples of content views.
- On the `CentOS7_to_RHEL7` content view page, click on the `Content views` tab.

![CentOS7_to_RHEL7 Content View](images/composite_content_view_for_convert2rhel.png)

- Notice that the CentOS7 and RHEL7 content views have been added to the CentOS7_to_RHEL7 composite content view. Click on either of the CentOS7 or RHEL7 content views and then the `Repositories` tab in each view.

![CentOS7 Content View Repositories](images/composite_content_view_centos_repos.png)

![RHEL7 Content View Repositories](images/composite_content_view_rhel_repos.png)

Currently, our CentOS7 nodes are configured to utilize the `CentOS7` content view, with associated `CentOS7_Dev` lifecycle environment. We will now change our CentOS7 nodes to instead consume the `CentOS7_to_RHEL7` composite content view via the associated `CentOS7_to_RHEL7_Dev` lifecycle environment during the conversion process.

- Return to the AAP Web UI browser tab and navigate to Resources > Templates by clicking on "Templates" under the "Resources" group in the navigation panel and click on `SATELLITE / Change content source for content host`.

![Satellite Change content source for content host](images/content_host_template.png)

- On the details page, review the job template settings and variables section, then click on "Launch".

![Satellite Change content source for content host](images/content_host_template_launch.png)

- On the survey dialog, for `Select inventory group`, select `CentOS7_Dev` from the drop down. Leave the specific content hosts limit field blank. for `Select target lifecycle environment for the content host`, select `CentOS7_to_RHEL7_Dev`, then click "Next".

![Satellite Change content source for content host survey](images/content_host_template_survey.png)

- On the preview dialog, review the various settings and if desired, review the Prompted Values/Variable section. When ready to proceed, click "Launch".

![Satellite Change content source for content host preview](images/content_host_template_launch_final.png)

- Verify that the Change content source for content host job completes successfully.

![Satellite Change content source for content host job output](images/content_host_job_output.png)

If you would like to verify the content host configuration has changed, switch to the browser tab where you are logged in to Satellite.

- Once the Satellite web UI is accessible, click on Hosts > Content Hosts. When the *Content Hosts* page is displayed, we should see that the CentOS7 content hosts are now configured to pull package content from the `CentOS7_to_RHEL7` content view and `CentOS7_to_RHEL7_Dev` lifecycle environment.

![Satellite Content Hosts](images/satellite_content_hosts2.png)

### Step 4 - Use AAP to Launch an Analysis Playbook Job

As we progress through the workshop, we'll refer back to this diagram to track where we are in our automation approach workflow. We are starting now in the highlighted block below:

![Automation approach workflow diagram with analysis step highlighted](images/conversion-workflow-hl-analysis.svg)
![Automation approach workflow diagram with analysis step highlighted](images/conversion-workflow-hl-analysis.svg)

The first step in converting our three tier app hosts will be executing the analysis playbook to generate the Convert2RHEL pre-conversion analysis report for each host. To do this, we will use the Ansible Automation Platform (AAP) automation controller host that has been pre-configured in your workshop lab environment.
The first step in converting our three tier app hosts will be executing the analysis workflow to generate the Convert2RHEL pre-conversion analysis report for each host. To do this, we will use the Ansible Automation Platform (AAP) automation controller host that has been pre-configured in your workshop lab environment.

- Return to the AAP Web UI browser tab and navigate to Resources > Templates by clicking on "Templates" under the "Resources" group in the navigation menu:

Expand All @@ -129,13 +182,13 @@ The first step in converting our three tier app hosts will be executing the anal

![Analysis job survey prompt on AAP Web UI](images/analysis_survey_prompt.png)

- For this workflow job template, the survey allows for choosing a group of hosts on which the workflow will execute against. For "Select EL Group to analyze" choose "CentOS_Dev" from the drop-down and click the "Next" button. This will bring you to a preview of the selected job options and variable settings.
- For this workflow job template, the survey allows for choosing a group of hosts on which the workflow will execute against. For `Select EL Group to analyze` choose `CentOS_Dev` from the drop-down and click the "Next" button. This will bring you to a preview of the selected job options and variable settings.

![Analysis job preview on AAP Web UI](images/analysis_preview.png)

- If you are satisfied with the job preview, use the "Launch" button to start the workflow job.

### Step 4 - Review the Workflow Job Output
### Step 5 - Review the Workflow Job Output

After launching the analysis workflow job, the AAP Web UI will navigate automatically to the workflow output page for the workflow you just started.

Expand All @@ -147,13 +200,13 @@ After launching the analysis workflow job, the AAP Web UI will navigate automati

![Analysis job "PLAY RECAP" as seen at the end of the job output](images/analysis_job_recap.png)

- Additionally, you can verify the status of each node by scrolling through the job output and checking for a message specific to each node indicating that the pre-conversion analysis was successful. If any issues were found, a quick synopsis message will be printed instead, as well as provising a path to the pre-conversion log file for further manual investigations.
- Additionally, you can verify the status of each node by scrolling through the job output and checking for a message specific to each node indicating that the pre-conversion analysis was successful. If any issues were found, a quick synopsis message will be printed instead, as well as providing a path to the pre-conversion log file for further, manual investigations.

![Analysis job node4 status message in job output](images/analysis_job_output.png)

- If any errors are experienced, the `CONVERT2RHEL / 03 Rollback` job template can be used to revert nodes back to the pre-conversion analysis state and steps can be taken to remediate any issues/errors, followed by a new pre-conversion analysis workflow template run. Repeat this process until the pre-conversion analysis returns SUCCESS.

### Step 4 - Challenge Lab: Analysis Playbook
### Step 6 - Challenge Lab: Analysis Playbook

Let's take a closer look at the playbook we just ran.

Expand Down Expand Up @@ -196,15 +249,17 @@ Can you find the upstream source repo and playbook code?
ansible.builtin.import_role:
name: infra.convert2rhel.analysis
```
By checking the `collections/requirements.yml` file in the `redhat-partner-tech/automated-satellite` git repo, we can discover that this role comes from another git repo at [https://github.com/heatmiser/infra.convert2rhel](https://github.com/heatmiser/infra.convert2rhel). It is the `analysis` role under this second git repo that provides all the automation tasks that ultimately runs the Convert2RHEL analysis scan and generates the report. *NOTE* We are utilizing a fork of the upstream infra.convert2rhel Ansible collection [https://github.com/redhat-cop/infra.convert2rhel](https://github.com/redhat-cop/infra.convert2rhel). Because the upstream collections is a fast moving project, we utilize a fork where we can closely manage the state of the code base to ensure optimal stability for the lab/workshop/demo environment.
By checking the `collections/requirements.yml` file in the `redhat-partner-tech/automated-satellite` git repo, we can discover that this role comes from another git repo at [https://github.com/heatmiser/infra.convert2rhel](https://github.com/heatmiser/infra.convert2rhel). It is the `analysis` role under this second git repo that provides all the automation tasks that ultimately runs the Convert2RHEL analysis scan and generates the report.

*NOTE* We are utilizing a fork of the upstream infra.convert2rhel Ansible collection [https://github.com/redhat-cop/infra.convert2rhel](https://github.com/redhat-cop/infra.convert2rhel). Because the upstream collections is a fast moving project, we utilize a fork where we can closely manage the state of the code base to ensure optimal stability for the lab/workshop/demo environment.

- In a new browser tab/instance, open the [https://github.com/heatmiser/infra.convert2rhel](https://github.com/heatmiser/infra.convert2rhel) URL. Drill down to the `roles/analysis` directory in this git repo to review the README and yaml source files.

When you are ready to develop your own custom playbooks to run conversions for your enterprise, you should consider using roles from the `infra.convert2rhel` Ansible collection to make your job easier.

## Conclusion

In this exercise, we learned about the end-to-end workflow used by our automation approach for doing RHEL-like OS conversions. We used a workflow template in AAP to submit a workflow job that cleared node ytum cache, performed an LVM snapshop of each node, and then ran the Convert2RHEL pre-conversion analysis on our three tier application servers. In the challenge lab, we explored the analysis playbook that we ran and how it includes a role from an Ansible collection.
In this exercise, we learned about the end-to-end workflow used by our automation approach for doing RHEL-like OS conversions. We used a workflow template in AAP to submit a workflow job that cleared node yum cache, performed an LVM snapshop of each node, and then ran the Convert2RHEL pre-conversion analysis on our three tier application servers. In the challenge lab, we explored the analysis playbook that we ran and how it includes a role from an Ansible collection.

In the next exercise, we will review the analysis reports we just generated.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

### Step 1 - Managing Convert2RHEL Pre-conversion Results

In the previous exercise, we used a job template/playbook to analyze our CentOS7 app servers. Behind the scenes, the `analysis` module from the `infra.convert2rhel` Ansible collection launched a Convert2RHEL pre-conversion analysis on each of our CentOS 7 app servers and once complete, parsed the pre-conversion analysis report for any issues that would either block the conversion from initiating or potentially failing. If any problems were found, then the Ansible Automation Platform automation job would have reported a failure.
In the previous exercise, we used a workflow template with associated job templates and playbooks to analyze our CentOS7 app servers. Behind the scenes, the `analysis` module from the `infra.convert2rhel` Ansible collection launched a Convert2RHEL pre-conversion analysis on each of our CentOS 7 app servers and once complete, parsed the pre-conversion analysis report for any issues that would either block the conversion from initiating or potentially failing. If any problems were found, then the Ansible Automation Platform automation job would have reported a failure.

- If we are using the Convert2RHEL utility to manually convert just a single CentOS host, we could simply get to a shell prompt on the host and look at the local report file output. In [Exercise 1.1, Step 2](../1.1-setup/README.md#step-2---open-a-terminal-session), we learned how to open an ssh session to one of our app servers. Follow those steps and after logging in, use this command to review the local Convert2RHEL pre-conversion report file:

Expand Down Expand Up @@ -104,7 +104,7 @@ less /var/log/convert2rhel/convert2rhel-pre-conversion.txt

### Challenge Lab: What if we were to experience warnings we are unsure of?

You may be wondering what if there are many warning issues listed in the report? Why would we be going forward with attempting a conversion without first resolving all the findings on the report? It's a fair question.
You may be wondering: what if there are many warning issues listed in the report? Why would we be going forward with attempting a conversion without first resolving all the findings on the report? It's a fair question.

> **Tip**
>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 662dda8

Please sign in to comment.