How to Deploy Ansible On a RHEL9 VM – Part 1

Ansible Playbooks:

After revisiting some of my ansible playbooks, I noticed that a few were no longer working. This prompted me to dig a little deeper and I realized the need to update my scripts. Since I initially created my playbooks on my MacBook and on a RHEL8 VM in my lab, I decided to start from scratch and share my journey.

Deploying Ansible on your control node on RHEL8, Centos or macOS was not that difficult, it did require Python 3.9 or newer installed and running a few pip commands. As part of the deployment of Ansible, you also needed to enable access to EPEL repositories.

This added a little complexity to getting my Ansible environment stood up, making sure everything lined up…

Since I decided to upgrade my scripts, I thought why not just start with the latest version of RHEL and currently that is RHEL9.2

In this blog post, I will demonstrate how to deploy RHEL9 and perform an update which will upgrade all packages and security patches.

A major benefit of RHEL9, ansible-core package is already available in the default package repository, so I don’t have to add any additional repositories like I had to with RHEL8.

Deploy RHEL9 VM:

For this deployment of RHEL9 in my lab, I obtained the ISO image from Redhat’s website.

Please note, this is for individual developer use ONLY, Redhat offers subscription models for Cooperate or Enterprise use cases.

After downloading the RHEL9 ISO image, I uploaded it to a shared datastore in my lab environment.

Since I will be heavily utilizing this VM and have available resources, I over provisioned the RHEL VM.

Deploying the VM is pretty straightforward, right click on Virtual Machines and select Create/Register VM.

Select Create a new virtual machine and click Next.

Choose name of VM, here I chose Redhat9.

Change the drop down of the following and match the following settings:

  • Compatibility: ESXi 8.0 Virtual Machine
  • Guest OS Family: Linux
  • Guest OS Version: Red Hat Enterprise Linux 9 (64-bit)

Click Next.

Select the location where to deploy the VM.

Customize Settings, as mentioned above, I over provisioned this VM, you can right size this to your needs.

Under the CD/DVD Drive section, browse to the location of your RHEL9 ISO image.

Validate settings and click Finish.

Power on VM and Open console window to select *Install Red Hat Enterprise Linux 9.2.

Configure RHEL9 Deployment

After Red Hat RHEL9 ISO image is deployed, it will start a configuration wizard.

Select Language and click Continue.

You will notice items highlighted in RED and those need to configured. Click on each option and click Done.

After you have configured all the required options, you are now ready to proceed with the installation.

You have now successfully installed a Red Hat VM and are ready to move on get Ansible deployed.

RedHat DNF Upgrade:

Before I proceed with deploying Ansible, I want to make sure the fresh install of RedHat is up to date on patches.

Lets start off by logging into the RedHat VM.

Launch the Shell Console by click on the highlighted box.

From the command prompt, I am going to run the following command with elevated privileges.

sudo dnf upgrade

You will be promoted to enter the password, enter that now.

You will see a list of patches and prompt asking to download, enter ‘Y’.

Here you will notice the patches being downloaded.

After you have successfully downloaded the packages, you will be prompted for permission to install them, enter ‘Y’.

You have successfully patched and updated your RedHat RHEL9 VM.

In the next blog post, I will install Ansible on Redhat.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top