Skip to the content.

ADR-003: Ansible-based Automation for Agent Installation

Date

2025-03-09

Status

Accepted

Decision Makers

Context

The OpenShift Agent-Based Installer requires several configuration files and steps to create bootable installation media. Manual creation and management of these configurations can be:

Considered Options

1. Manual Configuration

2. Shell Scripts Only

3. Ansible Automation (Selected)

Decision

Implement an Ansible-based automation approach with:

  1. Declarative Configuration
    ./hack/create-iso.sh $FOLDER_NAME
    
    • Use cluster.yml and nodes.yml for configuration
    • Generate templates with Ansible
    • Create ISO automatically
  2. Manual Option Preservation
    • Keep manual steps documented
    • Allow step-by-step execution
    • Support custom modifications
  3. Prerequisites Management ```yaml

    Required tools

    • ansible-core
    • nmstate
    • Ansible Collections from requirements.yml ```

Implementation

Directory Structure

playbooks/
├── create-manifests.yml
├── collections/
│   └── requirements.yml
└── templates/
    ├── agent-config.yml.j2
    ├── install-config.yml.j2
    └── other templates...

Configuration Examples

Located in examples/ directory:

examples/
├── baremetal-example/
├── vmware-example/
└── various configurations...

Usage Patterns

  1. Declarative Approach
    ./hack/create-iso.sh $FOLDER_NAME
    
  2. Manual Approach
    cd playbooks/
    ansible-playbook -e "@your-cluster-vars.yml" create-manifests.yml
    

Consequences

Positive

  1. Standardized configuration management
  2. Reduced human error
  3. Faster deployment
  4. Maintainable configurations
  5. Version-controlled templates

Negative

  1. Additional dependencies
  2. Initial setup overhead
  3. Ansible knowledge required

Validation

Configuration Steps

  1. Validate prerequisites:
    dnf install ansible-core nmstate
    ansible-galaxy install -r playbooks/collections/requirements.yml
    
  2. Verify configurations:
    • Check cluster.yml and nodes.yml
    • Validate template generation
    • Test ISO creation

Notes

The automation approach is particularly suited for:

Templates support various deployment types: