Skip to content

fix: Agent-Based Installer robustness fixes (workdir, DNS, ISO boot, ssh_agent)#508

Open
vinayakray19 wants to merge 6 commits into
IBM:mainfrom
vinayakray19:fix/abi-installer-robustness
Open

fix: Agent-Based Installer robustness fixes (workdir, DNS, ISO boot, ssh_agent)#508
vinayakray19 wants to merge 6 commits into
IBM:mainfrom
vinayakray19:fix/abi-installer-robustness

Conversation

@vinayakray19

@vinayakray19 vinayakray19 commented Jun 25, 2026

Copy link
Copy Markdown

Summary

A set of small, independent robustness fixes to the Agent-Based Installer (ABI)
flow, found while deploying OpenShift 4.22 ABI clusters on z/LinuxONE KVM. Each
fix is a separate commit and none change default behaviour for existing users.

Changes

1. Configurable OCP install work directory (refactor)

  • Adds roles/common/tasks/resolve_ocp_install_workdir.yaml which resolves a
    single ocp_install_workdir fact (defaulting to abi.ansible_workdir) and
    asserts it is set.
  • prepare_configs, setup_params, create_agent, and abi_install_complete
    now use ocp_install_workdir instead of hardcoding ~/ansible_workdir or
    repeating abi.ansible_workdir. This also fixes prepare_configs, which
    previously created/deleted a hardcoded ~/ansible_workdir that did not match
    the configured abi.ansible_workdir.

2. Make bastion nameserver2 optional in DNS config (fix)

  • roles/dns/templates/dns-named.conf.j2 referenced
    env.bastion.networking.nameserver2 unconditionally, causing a Jinja
    UndefinedError when only one upstream nameserver is configured. The second
    forwarder is now guarded and falls back to the cluster forwarder.

3. Keep agent VMs running after ISO boot (fix)

  • The ISO virt-install tasks used --wait=-1, which left the ISO-booted agent
    VMs powered off and stalled the install. --wait=-1 is removed from both the
    control and compute ISO commands, and two tasks were added: one waits until
    every VM definition is registered, and one ensures all agent VMs are running.

4. Run ssh_agent play as the login user with secrets (fix)

  • playbooks/create_abi_cluster.yaml: the "Setup SSH agent" play now sets
    become: false and loads group_vars/all.yaml and group_vars/secrets.yaml,
    so the ssh_agent role runs as the bastion login user and can see the
    secret-backed variables it needs.

Test plan

  • Deployed two OpenShift 4.22.0-ec.3 ABI clusters end-to-end on z/LinuxONE
    KVM (ISO boot) with these changes.
  • Confirm PXE boot path is unaffected (only ISO virt-install lines changed).
  • Confirm existing inventories with nameserver2 set still render identical
    named.conf forwarders.

vinayakray19 and others added 4 commits June 25, 2026 14:29
Add roles/common/tasks/resolve_ocp_install_workdir.yaml, which resolves a
single ocp_install_workdir fact (defaulting to abi.ansible_workdir) and
asserts it is defined. Use it across the prepare_configs, setup_params,
create_agent, and abi_install_complete roles instead of hardcoding
~/ansible_workdir or repeating abi.ansible_workdir, so the install
directory can be overridden per inventory and stays consistent.

Co-authored-by: Cursor <cursoragent@cursor.com>
named.conf unconditionally referenced env.bastion.networking.nameserver2
in the forwarders list, raising a Jinja UndefinedError when only a single
upstream nameserver is configured. Guard the second forwarder and fall
back to the cluster forwarder when nameserver2 is not defined.

Co-authored-by: Cursor <cursoragent@cursor.com>
With --wait=-1 the virt-install async tasks left the ISO-booted agent VMs
powered off, stalling the agent-based install. Remove --wait=-1 from both
the control and compute ISO virt-install commands, then add a task that
waits for every VM definition to register and an explicit step to ensure
all agent VMs are running before the install proceeds.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Setup SSH agent play ran with the default become and without loading
inventory vars, so it escalated to root and could not see secret-backed
variables. Set become: false and load group_vars/all.yaml and
group_vars/secrets.yaml so the ssh_agent role runs as the bastion login
user with the values it expects.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread roles/boot_abi_agents/tasks/main.yml Outdated
vinayakray19 and others added 2 commits June 25, 2026 15:52
CI runs ansible-lint on changed files, and touching this role surfaced
pre-existing violations. Use FQCN module names (file/copy/stat/debug),
replace truthy `yes` with `true`, remove a trailing space, order task
keys as name/when/block, and shorten the over-length web-console line.
No behavioral change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Address review feedback that removing --wait=-1 could break the ABI flow.
Restore upstream behavior by default: --wait=-1 is still passed for the
ISO virt-install commands unless the new abi.iso_virt_install_wait toggle
is set to false. This lets operators opt out on hosts where the async
(poll: 0) virt-install job being reaped at the async timeout powers the
agent VMs off mid-install. The follow-up "ensure VMs running" task stays
as a safety net.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants