Search

Ansible Automation Platform for OpenShift Virtualization in a Multi-cluster Setting

Share it

In a world where Red Hat OpenShift is becoming increasingly prominent, organizations are embracing a centralized hub cluster strategy to automate their IT operations effectively. This hub cluster, typically situated in a management segment, serves as the home for centralized elements such as the Red Hat Ansible Automation Platform, Red Hat Advanced Cluster Management for Kubernetes, and Red Hat Advanced Cluster Security for Kubernetes.

The growing adoption of Red Hat OpenShift Virtualization has highlighted the necessity for automated procedures for managing virtual machine (VM) tasks on both Day-1 and Day-2. Having a centralized Ansible Automation Platform model within the hub cluster enables comprehensive automation across various OpenShift clusters spread across multiple zones, data centers, and clouds.

This strategy revolves around automating the creation of VMs on remote OpenShift clusters by utilizing an Ansible Automation Platform deployed centrally on the hub cluster. The virtualized workloads are then expected to operate on distinct remote clusters.

The configuration of Ansible Automation Platform to interact with a remote OpenShift cluster for VM management will be the focus of this discussion.

Illustration of key environment components

Prior to delving into the specifics of the Ansible Automation Platform, it’s essential to grasp a few crucial concepts. Understanding these basics is integral to realizing the functionality of the Ansible Automation Platform and harnessing its advantages.

Container Groups: indicate a pointer to an OpenShift/K8s cluster where the Ansible Automation Platform can initiate pods in a predefined namespace to execute a job template/playbook within the remote Red Hat OpenShift environment. These pods exist temporarily during execution, ensuring a clean environment for each job run.

Kubevirt Inventory: An Ansible inventory plugin designed to discover virtual machines running on Kubernetes/OpenShift through KubeVirt or OpenShift Virtualization.

Utilizing Certified Content for Red Hat OpenShift Automation

This workflow maximizes certified collections from the Ansible automation hub to streamline interactions with Red Hat OpenShift and OpenShift Virtualization.

  • red hat.openshift: Offers modules for creating Kubernetes resources in your OpenShift cluster.
  • redhat.openshift_virtualization: Streamlines VM creation on OpenShift Virtualization and involves an inventory plugin for syncing OpenShift VMs with Ansible hosts.
  • kubernetes.core: Provides modules for retrieving information on OpenShift/Kubernetes resources.

Illustration retrieving Automation Hub token

Retrieving Automation Hub token, server URL, and SSO URL

Configuration of Ansible Automation Platform for Content Access

To make use of certified collections within the automation controller, follow these steps:

Obtain Hub Credentials: Log in to the Ansible automation hub at a specified URL, navigate to “Automation Hub” -> “Connect to Hub,” and generate a token under “Offline Token.” Record the token, server URL, and SSO URL.

Adding Ansible automation hub credentials

Adding the Ansible automation hub credentials in Ansible Automation Platform

Update Organization Settings: Visit “Access” -> “Organizations,” select your organization, click “Edit,” and access “Galaxy Credentials.” Assign the newly created Ansible automation hub credential and set it as the top priority.

Updating organization settings with Ansible automation hub credential

Updating the organization settings to add the Ansible automation hub credentials

Having configured Ansible Automation Platform to utilize Red Hat Ansible Certified Content Collections from the Ansible automation hub, we can proceed to create the necessary workflow resources.

Would You Like to Read More? Find the original content [here](https://www.redhat.com/en/blog/ansible-automation-platform-openshift-virtualization-multi-cluster-environment).

🤞 Don’t miss these tips!

🤞 Don’t miss these tips!

Solverwp- WordPress Theme and Plugin