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>