Skip to content

Add capability to generate dynamic inventory per target cluster #45

@albertoflorez

Description

@albertoflorez

Overview

We need to add a feature or role to our openshift virtualization migration collection that provides the ability to dynamically generate an Ansible inventory of all Virtual Machines deployed within a specific target OpenShift cluster.

Problem Statement

Currently, setting up an inventory using the redhat.openshift.openshift_virtualization plugin requires manual configuration and lacks a standardized, automated way within our collection to scope the inventory to a specific cluster context. To scale our Migration Factory workflows, the collection needs to inherently support generating or templating inventories targeted at a specific cluster.

Proposed Solution

Introduce a mechanism (such as a dedicated role, playbook, or inventory template) within the collection that automates the generation of a cluster-specific inventory.

The implementation should:

  • Allow specifying a target cluster's connection details as variables.
  • Generate a functional inventory configuration using the redhat.openshift.openshift_virtualization plugin tailored to that specific cluster.
  • Provide clean mapping so that the resulting inventory accurately reflects all OpenShift Virtualization workloads (VMs/VMIs) running on that specific cluster.

Technical Requirements

  • Create a role or template within the collection to output/handle cluster-scoped dynamic inventory configurations.
  • Ensure it integrates seamlessly with AAP (Ansible Automation Platform) credential types for OpenShift/Kubernetes clusters.

Acceptance Criteria

  • The collection includes a structured way (role or template) to generate an inventory for a specific OpenShift cluster.
  • The generated inventory successfully targets only the VMs running on the defined cluster.
  • Documentation and an example playbook are provided within the repository showing how to generate a cluster-specific inventory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions