When the ansible-test timeout is enabled, a callback plugin is injected
into ansible-playbook that uses faulthandler.dump_traceback_later to
write all thread stacks to a file shortly before the deadline. This
provides diagnostic information for intermittent CI hangs where the
process stops producing output with no traceback or error.
Also fixes collection/setup.sh to handle multiple colon-separated
paths in ANSIBLE_COLLECTIONS_PATH.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix IndexError in free strategy when hosts become unreachable
Fixes an IndexError crash in the free strategy plugin when hosts
become unreachable during playbook execution.
The bug occurred when:
- last_host index persists across outer loop iterations
- hosts_left is regenerated each iteration via get_hosts_left()
- Some hosts become unreachable between iterations
- hosts_left shrinks but last_host retains its previous value
- Accessing hosts_left[last_host] raises IndexError
The fix adds a bounds check after regenerating hosts_left to reset
last_host to 0 if it's out of bounds. This preserves the round-robin
fairness algorithm while preventing the IndexError.
Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* integration test
* review comment fixes
* ci_complete
* Pass malformed role requirements as positional arguments to prevent arbitrary git configuration
* Add test coverage, checking for specific errors and that git clone is always followed by --
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
* Drop Python 3.12 controller support
* Remove obsolete code
* Remove obsolete centos6 test code
* Skip tests on unsupported platforms
* Work around lack of Alpine controller support in tests
* While modifying the user with lusermod command, warn user
if home directory does not exists and move_home is set to
true.
Fixes: #37398
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
* Allow root to use sudo on managed Alpine VMs
This fixes the become_su test on Alpine when running non-split.
* Remove test user sudoers file when removing the user
* Recognize password failures for BusyBox su
Only for BusyBox since that was the context where this initally came up. It may
make sense to add this warning more broadly.
chsh on Alpine warns but does not error when changing to an invalid shell.
Other distros error with an invalid shell.
Signed-off-by: Sam Doran <sdoran@redhat.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
PR #87041
PR #87010 bumped the container used in CI for uploading the coverage
measurements to Codecov and its runtime now uses Python 3.13.
The previously set `.azure-pipelines/scripts/dependencies/codecov.txt`
pip constraints used to lock down the transitive dependencies in that
environment were of older versions and `test-results-parser==0.5.4`
caused pip to trigger building this dependency from an sdist due to
the latest platform-specific wheel available for that version being
tagged for Python 3.12.
The new container does not have enough of the build toolchain and the
build fails being unable to find the `cc` linker [[1]].
This patch mass-upgrades the transitive dependencies in said deptree
to newer versions that also ship platform-specific wheels for Python
3.13 and 3.14.
[1]: https://dev.azure.com/ansible/ansible/_build/results?buildId=181432&view=logs&j=d7668ad9-d7bb-5ae4-c14f-5061b89e467d&s=44856301-4c0b-5572-5f50-eb8e385c84fd&t=7f884d87-6a36-516f-9067-af4cf77c020d&l=93
ci_coverage
ci_complete
* fix partial socket reads
* cap agent response size to 256 KiB
* fix wire format for zero-length binary_string, unicode_string and mpint
* separate key and comment in identities response per the protocol
* remove KeyList/PublicKeyMsgList in favor of inline parsing and Identity dataclass
* rename comments -> comment
* switch KeyAlgo to StrEnum
ci_complete
UnionTech OS (UOS) Server is RPM-based and built on top of openAnolis
or openEuler, but the existing 'Uos' branch in parse_distribution_file_Debian
classified all UOS variants (including the Server editions) as Debian.
UOS Server advertises PLATFORM_ID="platform:uel*" in /etc/os-release
on every released image (uel20 for the openEuler-based E version with
codename 'fuyu', uelc20 for the openAnolis-based A version with codename
'kongzi'). The Debian-based Desktop edition has no such PLATFORM_ID.
This change adds a dedicated parse_distribution_file_UnionTech that:
* matches /etc/os-release when PLATFORM_ID starts with platform:uel
* matches /etc/redhat-release when it contains 'UnionTech OS Server release'
or 'UOS Server release' (some A-version images symlink redhat-release
to uos-release)
* sets distribution to 'UnionTech', preserving the underlying base via
distribution_release ('kongzi' for A version, 'fuyu' for E version)
The Debian-based Desktop edition is unchanged: parse_distribution_file_Debian
returns early for the 'Uos' branch only when PLATFORM_ID="platform:uel*"
is present, so existing Desktop fixtures keep their os_family=Debian.
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
* Defer patch target attribute failure until verified needed
* Fixes startup failure under Python 3.15.0b1 on dataclass ClassVar annotation patch (which appears to have been fixed).
* Adds explicit failure if the target attribute does not exist but `is_patch_needed` is True.
* Added surrogate test coverage for the new defensive error case.
* import boilerplate
* skip coverage on unused test impl
Co-authored-by: Matt Clay <matt@mystile.com>
---------
Co-authored-by: Matt Clay <matt@mystile.com>
* ansible-test - Replace Ubuntu 22.04 with 26.04
* Remove obsolete AppArmor work-around
* Fix connection_local integration test
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
* Fix apt integration test
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
* Skip apt_repository test on Ubuntu 26.04+
The module is deprecated, but it still tested on Ubuntu 24.04.
* Fix apt test
---------
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
* According to `sources.list(5)` man pages, only four fields are mandatory
Types, URIs, Suites, Component.
Validate as per this requirement while adding new source in sources.list.
Fixes: #85715
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
* also remove unused parameters from inner function
* Ensure no_log does not use subsets
Sort strings before using so the longer ones are processed first
avoiding strings that are subsets of each other creating partial
results.
Co-authored-by: David Shrewsbury <Shrews@users.noreply.github.com>
* winrm/psrp - apply no_log to stdout/stderr logs
This change censors the raw stdout/stderr logging used on the `winrm`
and `psrp` connection plugins with a verbosity level of 5 being set.
While by default the raw output isn't sensitive if a user has set a task
with `no_log: true` we shouldn't be displaying the raw results of that
task.
* Apply suggestions from code review
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
---------
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>