55473 Commits

Author SHA1 Message Date
Matt Clay b475463834 Fix field names in exception messages (#87079) 2026-06-16 13:36:28 -04:00
Matt Clay 25ebd3d0f5 Fix fold deserialization on tagged time/datetime (#87080) 2026-06-16 13:34:05 -04:00
David Shrewsbury d772fe65b7 Use errno symbol instead of hardcoded value in wait_for (#87087) 2026-06-11 11:31:41 -04:00
Matt Clay 5e5d863173 ansible-test - Add timeout callback (#87091)
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>
2026-06-10 13:11:55 -07:00
David Shrewsbury 08a71d148e Fix IndexError in free strategy when hosts become unreachable (#87037)
* 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
2026-06-09 12:16:31 -04:00
Sloane Hertel bebae770d3 Fix ansible-galaxy-role test isolating stderr (#87085)
Follow up to #87070 to fix the test

Fix ansible-galaxy-role test isolating stder

Remove new feature to backport as-is
2026-06-08 16:22:45 -04:00
Matt Clay fc5931c90b Test RHEL 9 using Python 3.14 (#87073)
This was overlooked in https://github.com/ansible/ansible/pull/87057
2026-06-05 23:44:45 +00:00
Sloane Hertel edee59aa15 Fix CVE-2026-11332 - prevent role requirements from configuring git (#87070)
* 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>
2026-06-05 18:38:56 -04:00
Matt Clay 31b3cc35e6 Drop Python 3.12 controller support (#87057)
* 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
2026-06-05 10:15:42 -07:00
Abhijeet Kasurde 744a880709 user: Warn if move_home is true and home dir does not exist (#87056)
* 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>
2026-06-05 13:20:30 +00:00
sivel / Matt Martz 7181e04c57 ssh - document concerns with LocalForward (#87035)
* Add docs indicating that LocalFoward along with the defaults can lead to an insecure config
2026-06-05 13:09:10 +00:00
Maxwell G 1b31d6c3f1 Fix comma-splice in include_vars documentation (#87055) 2026-06-05 08:57:25 -04:00
Matt Clay 147ca90b27 Fix deprecation message typo for get_platform in basic.py (#87065) 2026-06-05 07:17:25 +00:00
Abhijeet Kasurde 09f1ac42d5 config: Use correct key for inject_invocation (#87000)
* inject_invocation inadvertently used 'interpreter_python' key
  in config file instead 'inject_invocation'.

Fixes: #86999

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-06-04 16:42:23 -07:00
Matt Clay 8b062bb267 Recognize password failures for BusyBox su (#87060)
* 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
2026-06-03 13:46:08 -07:00
Abhijeet Kasurde 9dfed16dae tests: test for collection_skeleton_ignore (#86896)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-06-02 08:26:04 -07:00
Minh Vu 2a628c04c9 user: fix Alpine move_home ordering (#87044) 2026-06-02 04:40:30 -07:00
Sam Doran 1d398ae8af user - Warn when an invalid shell is specified on BusyBox systems (#86342)
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>
2026-05-29 14:38:20 +00:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) d25ac062dd 🧪 Pin Codecov CLI uploader env for Python 3.13
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
2026-05-28 16:16:08 +00:00
sivel / Matt Martz 73f4bdb681 Add ai context skill (#87038) 2026-05-28 10:22:12 -05:00
Matt Clay ba21909655 Update AZP container (#87010) 2026-05-27 19:29:13 -07:00
David Shrewsbury ea0024944f Fix dnf/dnf5 documentation for exclude parameter (#87034)
* Sanity fix
* Test dnf `exclude` parameter


Co-authored-by: Patrick Kingston <pkingsto@redhat.com>
2026-05-27 05:35:01 -07:00
sivel / Matt Martz 28dadef725 Update skills for compat with non-claude agents (#87032) 2026-05-26 17:40:34 +00:00
Matt Davis 10186793b3 Fix internal exception type on result thread (#87017)
* Bogus auto-import of sqlite.NotSupportedError instead of stdlib NotImplementedError
* No meaningful external visibility
2026-05-21 15:28:19 -07:00
Martin Krizek cef01730fb ssh-agent: hardening (#86921)
* 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
2026-05-20 14:21:01 -05:00
sivel / Matt Martz 028f8d9d0c move claude review command to skill (#87002) 2026-05-20 10:29:17 -05:00
Felix Fontein c70c5c63a4 Allow positional for lookup plugins (#86986)
* Make validate-modules aware of positional.
* Mark positional lookup arguments as positional on existing lookups.
2026-05-20 11:01:22 -04:00
simonLeary42 5a4f60dc03 git: remove redundant error checking (#86937)
* remove redundant error checking that makes bad error message

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2026-05-20 07:49:00 -04:00
Kay Yan c1d7cf45f6 facts: classify UnionTech OS Server as RedHat os_family (#86959)
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>
2026-05-20 07:46:38 -04:00
sivel / Matt Martz 57f4901faf update sqlite-libs during bootstrap (#87003) 2026-05-19 16:19:44 -05:00
Anna Rift e35d82cb1b Fix grammar and capitalization in vars lookup examples (#86988) 2026-05-19 11:10:03 -04:00
Matt Clay d60f11409b ansible-test - Update base/default containers (#86958) 2026-05-15 18:17:43 -07:00
Matt Davis 405a6052b0 Defer patch target attribute failure until verified needed (#86976)
* 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>
2026-05-15 19:18:51 +00:00
Matt Clay f4203e90e4 ansible-test - Replace Ubuntu 22.04 with 26.04 (#86894)
* 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>
2026-05-14 16:51:34 -07:00
Abhijeet Kasurde 05797da13e apt_repository: validate line in sources.list (#85881)
* 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>
2026-05-13 12:54:58 -07:00
Matt Davis cb535cf3d3 Fix broken callback dispatch on skipped meta tasks (#86977)
* Fix broken callback dispatch on skipped meta tasks
2026-05-12 16:16:42 -04:00
Abhijeet Kasurde b7c0900272 filter: add support for POSIX extended in regex_escape (#86949)
* add support for POSIX extended in regex_escape filter

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-08 18:48:32 +00:00
Brian Coca 5c55372345 Ensure no_log does not use subsets (#86939)
* 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>
2026-05-07 15:12:07 -04:00
sivel / Matt Martz ae4d2b8291 Add docs/comments to IncludedFile to clarify behavior (#86942) 2026-05-06 14:30:34 -04:00
Abhijeet Kasurde 6ffe277fbf dnf: add test for broken config file (#86901)
Fixes: #85681

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-05 12:36:41 -07:00
Abhijeet Kasurde ef4cb719c7 ansible-doc: remove unnecessary parameter value (#86900)
* remove extraneous display.vvv and display.warning parameter

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-05 08:21:01 -07:00
Abhijeet Kasurde 87547967e6 cli: handle empty PAGER value (#86909)
Fixes: #86898

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-05 08:19:58 -07:00
Abhijeet Kasurde 30d7849e7e Deprecate is_module parameter (#86931)
* Use plugin_type=module instead of is_module=True

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-05 11:07:03 -04:00
Jordan Borean 49f1615157 winrm/psrp - apply no_log to stdout/stderr logs (#86919)
* 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>
2026-05-01 15:13:31 +10:00
sivel / Matt Martz ff6b7e404a Add OrderedSet class (#84134) 2026-04-30 14:56:26 -05:00
sivel / Matt Martz f074c20929 Drop email in favor of our own multipart generator. Fixes #76666 (#86687) 2026-04-30 14:54:54 -05:00
David Shrewsbury 776f90ae4b Handle None return from read() in run_command() (#86922) 2026-04-30 15:03:21 -04:00
sivel / Matt Martz 883360fa00 humans (#86910) 2026-04-28 13:30:32 -05:00
Brian Coca 639bab6a44 sudo become plugin: add sudo-rs prompt support (#86175)
fixes #85837

Also move to fstrings
2026-04-27 12:51:34 -04:00
Abhijeet Kasurde 266cb0ee16 Parameterize fetch_url tests (#86892)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-04-27 04:23:57 -07:00