How ibm/ansible-openshift-provisioning works
Project type and purpose
• This is an open-source Ansible automation tool for provisioning OpenShift clusters on KVM and IBM zSystems/LinuxONE.
• It orchestrates virtual machines (LPARs, KVM guests), network services (DNS, HTTPD, HAProxy), and OpenShift installer workflows (bootstrapping, agent-based install, HCP integration).
File structure
• Top-level:
• playbooks/ – contains orchestration entry points (0_setup, create_lpar, create_kvm_host, site.yaml, etc.)
• roles/ – implements reusable actions (create_bastion, boot_LPAR, download_ocp_installer, haproxy, dns, etc.)
• inventories/ – host/inventory definitions, group_vars & host_vars templates
• collections/ – bundled Ansible collections (posix, community, IBM zhmc)
• docs/ – markdown documentation and images
• ansible.cfg, mkdocs.yaml, .github/ – configuration for linting, CI, documentation
• Patterns:
• IaC (Infrastructure as Code) using Ansible roles & playbooks
• Inventory-driven execution
• Modular roles organized by function (compute, network, storage, cluster install)
• Use of Jinja2 templates (.j2) for dynamic config files
Insights from README
• Purpose: automate OpenShift v4.x provisioning for multi-architecture (s390x, multi) on IBM platforms
• Key features: FIPS support, zVM Hipersocket for Hosted Control Plane (HCP), LPAR & KVM compute nodes
• Deprecation: openvpn, RHEL8
Components
a. Main components
• Ansible Control Node: the central orchestrator with playbooks, roles, collections, inventory
• Inventory Store: static/dynamic host definitions (LPAR hosts, KVM hosts, bastion, bootstrap, control-plane, compute)
• Virtualization Hosts: IBM zSystems LPAR manager, KVM hypervisor hosts
• Network Services: DNS server, HTTPD/mirror, HAProxy load balancer
• OpenShift Installer: external binaries/artifacts (downloaded via roles/get_ocp, download_rootfs)
• OpenShift Cluster: bootstrap node, control-plane nodes, compute nodes, agent service configs
• Hosted Control Plane (HCP) services (optional): InfraEnv namespace, agent namespace on HCP
b. Relationships and interactions
• Control Node → (SSH) → Virtualization Hosts & Bastion: run playbooks/roles to provision VMs
• Control Node → Inventory: read host groups & variables
• Control Node → External Repos: download installer binaries, container images, rootfs
• Control Node → DNS/HTTPD/HAProxy: configure and deploy services via templates
• Virtualization Hosts → VM guest network: connect to DNS, HTTPd, HAProxy
• Bootstrap & Agent VMs → Pull OpenShift installer → Communicate with Control Node during install
• HCP integration: Control Node posts agent configs to HCP API, monitors agent states
c. Architectural patterns and principles
• Infrastructure as Code (Idempotent, declarative)
• Modular & reusable roles
• Inventory-driven, group-vars/host-vars separation
• Template-based configuration
• Sequential orchestration: setup → create infra → bootstrap cluster → wait for completion → cleanup
d. Key technologies/frameworks
• Ansible Engine & Collections
• QEMU/KVM & IBM zhmc modules
• OpenShift Installer (ocp versions)
• Jinja2 templates for configs
• mkdocs for documentation, GitHub Actions for CI/lint
Detail and essential elements
• Break playbooks into phases: setup, create VM, configure network, deploy services, install cluster, verify, teardown
• Roles as sub-components of Ansible Control Node or group them by function
• Inventory groups (default, hcp, disconnected, abi) and key group_vars influencing flow
• Do not clutter with every single role; instead cluster similar roles (e.g., “LPAR provisioning,” “KVM provisioning,” “Cluster config,” “Network config,” “HCP integration”)