Fix: Enable Ansible pipelining for CentOS builds 91/73891/1 master v0.17.4
authorAnil Belur <abelur@linuxfoundation.org>
Thu, 13 Nov 2025 23:43:58 +0000 (09:43 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 13 Nov 2025 23:49:43 +0000 (09:49 +1000)
commitfccb3974f81a5859107eb8284beeeb3fbab39ac1
tree1d8430fb2e085935f8291351e8f6fa8ee04364be
parentd02b15305d8e8ba15a8f2601bc7c207c06feb9d4
Fix: Enable Ansible pipelining for CentOS builds

Enable Ansible pipelining for CentOS builds through bastion.
Enable ANSIBLE_PIPELINING=True when local_build=true to fix CentOS
Stream 9 Ansible provisioning failures through bastion/jump hosts.

Root cause: CentOS Stream 9 images fail with SCP/SFTP transfer errors
during Ansible provisioning, even with ANSIBLE_SCP_IF_SSH=True and
--scp-extra-args '-O' flags. The error occurs when Ansible tries to
transfer Python module wrappers to the remote system:

  failed to transfer file to /home/cloud-user/.ansible/tmp/.../
  AnsiballZ_command.py

This issue is platform-specific - Ubuntu 24.04 works fine with the
current SCP/SFTP settings, but CentOS Stream 9 fails consistently.

Solution is Enable Ansible pipelining for local builds
(through bastion). Pipelining reduces SSH connections and avoids
temporary file transfers by sending Python code directly over SSH
stdin, completely bypassing the SCP/SFTP file transfer mechanism
that's failing on CentOS.

Benefits:
- Fixes CentOS Stream 9 Ansible provisioning failures
- Reduces number of SSH connections (performance improvement)
- Avoids SCP/SFTP file transfer issues entirely
- Still maintains SCP with -O flag as fallback for non-pipelined
  operations

Changes:
- Changed ANSIBLE_PIPELINING=False to ANSIBLE_PIPELINING=True when
  local_build=true
- Applies to all templates for consistency
- Jenkins builds (local_build=false) unchanged

Templates updated:
- builder.pkr.hcl
- docker.pkr.hcl
- devstack.pkr.hcl
- devstack-pre-pip-yoga.pkr.hcl
- windows-builder.pkr.hcl

Note: Pipelining requires that 'requiretty' is disabled in
/etc/sudoers on the target system. Modern cloud images (Ubuntu 24.04,
CentOS Stream 9) have this disabled by default.

Change-Id: Ide77e7773447c7054a723ed8653081e5420644da
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
releasenotes/notes/fix-centos-ansible-pipelining-c9af3ec8f4a9b2c3.yaml [new file with mode: 0644]
templates/builder.pkr.hcl
templates/devstack-pre-pip-yoga.pkr.hcl
templates/devstack.pkr.hcl
templates/docker.pkr.hcl
templates/windows-builder.pkr.hcl