ansible share image

Most of the time, we create our own Ansible playground to test Playbooks, features of the Red Hat Ansible Automation Platform (AAP), and many other things. We create our dedicated environment to test AAP for faster troubleshooting and resolution of customer issues.

Previously, it was a pain to install virtual machines on a Mac with an M1 chip. But now, Red Hat Enterprise Linux (RHEL) VMs can be easily installed using UTM, a system emulator and virtual machine host for macOS.

How to install a RHEL VM using UTM

It should take less than two hours to finish the setup, including installation.

To create VMs (RHEL 8.6 for automation controller) on Mac M1 machines using UTM, follow these steps:

  1. Download and install UTM.

  2. After installation, click “+” to create a VM.

  3. Select virtualize and click Linux.

  4. Download the RHEL 8 ISO DVD image.

  5. Click on browse and select the image. Then click continue.

  6. Select the RAM for the automation platform as per the AAP-2.2 minimum requirements document.

  7. Select the 100GB disk size, then click continue.

  8. Give the appropriate name to your VM, then check the Open VM Settings button.

  9. Navigate to the network section. Under network mode, select bridged (advanced).

  10. Click the Play button to start the installation.

  11. Fill in the details you need to install RHEL 8 as your VM.

  12. After the installation is complete, close the VM.
  13. Click the VM name in UTM and unselect the CD/DVD option. Now your RHEL machine will start normally.

  14. Enable the wired connection from the network connection settings.

Figure 1 illustrates the installed RHEL 8 VM.

A screenshot of the installed RHEL 8 virtual machine.
Figure 1: Your VM is ready to use!

Install AAP on RHEL VM

To get your VM ready to install AAP 2.2, follow these steps:

  1. Open the terminal and type ifconfig. Note that the IP address will be in a similar subnet of your Mac IP address.

  2. Open a terminal in your Mac machine and connect from your Mac to the newly created VM via SSH.

  3. Now your VM is ready to install AAP 2.2. Create a Red Hat Registry Service Account, following the instructions in the Creating Registry Service Accounts guide.

Now install AAP 2.2 by following these steps:

  1. Download AAP-2.2 from the Red Hat Ansible Automation Platform Product Software site.
  2. Edit the inventory file and add the correct hostname for your automation controller.
  3. Mandatory parameters for inventory file:
    • [automationcontroller]
    • [all:vars]: Admin password for your AAP controller
    • pg_password: Add password for database.
    • registry_username and registry_password: Credentials for container registry to pull execution environment images.
  4. Run the setup.sh script.

The following listing illustrates a snippet of the inventory file for AAP-2.2 installation.

# control.example node_type=control
# hybrid.example node_type=hybrid
# hybrid2.example <- this will default to hybrid
[automationcontroller]
#192.168.0.9 ansible_connection=local
#127.0.0.1 ansible_connection=local
aap ansible_connection=local
[automationcontroller:vars]
peers=execution_nodes

After successfully finishing the setup script, you can access the automation controller server from https://<TOWER_SERVER_NAME>/. In this scenario we are using aap as the hostname, so the URL will be https://app/ to access our automation controller UI.

Figure 2 illustrates the UI for the AAP-2.2 controller.

Figure 3 : AAP controller UI
Figure 2: AAP-2.2 controller UI

Note that the newly created VM should define a hostname in /etc/hostname. It would be best if you used this name in the automation controller. Otherwise, the installation will fail. Here's how you'd check the hostname of the controller machine in this file:

[root@aap aap-2.2-test]# cat /etc/hostname
aap

Summary

Now that we have shown you how easy it is to install RHEL VMs using UTM, try it for yourself. Refer to the Red Hat Ansible Automation Platform 2.2 Documentation and Red Hat Ansible Automation Platform Installation Guide for further information and resources. Feel free to comment below. We welcome your feedback.