Commit Graph
55499 Commits
Author SHA1 Message Date
908c98c92b genent: fail with error on platforms like Alpine when service is provided (#87222)
* Platforms like Alpine, Busybox which implements musl,
  does not support providing service with getent command.
  Fail with an error on such platforms.

Fixes: #85568

Signed-off-by: metformin503 <hou_huangbolin@126.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-07-23 14:00:01 -07:00
Matt ClayandGitHub b7bdaeac48 ansible-test - Replace Alpine 3.23 with 3.24 (#87279) 2026-07-21 23:07:24 -07:00
Jordan BoreanandGitHub e9b8425e42 Use debugpy from VSCode bundle (#85870)
Ensure that the `debugpy` module bundled by VSCode is included in the
debug environment set by `ansible-test shell --dev-debug-on-demand`.
This means that `debugpy` does not need to be manually installed in the
Python environment running Ansible.
2026-07-22 14:55:48 +10:00
Matt ClayandGitHub 5c869b3d5c ansible-test - Update base/default containers (#87278) 2026-07-22 04:02:47 +00:00
Brian CocaandGitHub 7d7b8d905b mask_url function to ease masking auth data in urls (#87256) 2026-07-17 15:20:30 -04:00
Sergey SannikovandGitHub 35e81f866f Fix uncaught OverflowError in check_type_int for infinity strings (#87253) 2026-07-17 14:45:31 -04:00
Apoorv DarshanandGitHub 5149f7c640 ansible-config: default to checking all plugin configs (#87212)
* ansible-config: default validate to checking all plugin configs

ansible-config validate defaulted to -t base, so any configuration file
using a section owned by a plugin (e.g. [ssh_connection]) was reported
as an unknown section, and keys inside such sections were never
validated at all - a stock, perfectly valid ansible.cfg failed
validation out of the box.

Default the validate action to -t all so installed plugin configuration
is taken into account. An explicit -t still narrows validation, and the
other ansible-config actions keep their base default (the -t default is
now resolved per action in post_process_args, since the shared parent
parser action object cannot carry per-subcommand defaults).

Fixes #86398

Signed-off-by: Apoorv Darshan <ad13dtu@gmail.com>

* Move -t to per-default shared parsers built by a factory

Per review: instead of a None sentinel resolved in post_process_args,
provide two small shared parent parsers for -t (one with default
'base', one with default 'all', built by a factory) so each
subcommand's --help states its actual default.

Signed-off-by: Apoorv Darshan <ad13dtu@gmail.com>

* Address review: parametrize ansible-config type tests

Deduplicate the three near-identical tests into a single
@pytest.mark.parametrize with descriptive IDs, return the resolved type
directly from the helper, add return-type annotations, and turn the
helper's leading comment into a docstring.

* Default ansible-config type to all for every action

Broaden the new default as requested in review, while keeping -t base as the compatibility override for users who need the previous behavior. Cover every action and both explicit override paths in the parser tests.

Assisted-by: OpenAI Codex
Signed-off-by: Apoorv Darshan <ad13dtu@gmail.com>

* Move ansible-config default coverage to integration tests

Exercise the public CLI across every action and run existing init, validate, and dump scenarios without an explicit type. Remove the parser-only unit test and use translation-friendly changelog wording.

Assisted-by: OpenAI Codex
Signed-off-by: Apoorv Darshan <ad13dtu@gmail.com>

* Document ansible-config default as breaking

Move the entry into the generated porting-guide section and document the -t base compatibility override.

Assisted-by: OpenAI Codex
Signed-off-by: Apoorv Darshan <ad13dtu@gmail.com>

---------

Signed-off-by: Apoorv Darshan <ad13dtu@gmail.com>
2026-07-17 14:34:17 -04:00
Sadovoi GrigoriiandGitHub b31b74b87f clarify meta: refresh_inventory documentation (#87218)
* clarify variable plugins are not reloaded by refresh_inventory

* document host_group_vars does not reload modified files while ansible is executing
2026-07-16 13:22:10 -04:00
2da050b287 Reject non-contiguous netmasks in is_netmask (#87235)
is_netmask only validated each octet against VALID_MASKS independently and
never checked that the octets form a contiguous run of network bits. As a
result masks like 255.255.0.255, 254.255.255.0 or 0.255.0.0 were reported as
valid, and downstream helpers such as to_masklen/to_subnet then produced
nonsensical results.

Verify that the assembled 32-bit mask is a contiguous block of 1s followed by
0s.

Signed-off-by: semx <7532921+semx@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2026-07-15 07:56:03 -07:00
db1e22f48e Fix collection loader iterator for ext modules (#84758)
* Fix collection loader iterator for ext modules

Fixes the collection loader iter_modules logic to return compiled Python
extension modules. This loader is used when attempting to call
`pkgutil.iter_modules` on a package that is contained inside the
`ansible_collections` path. Before extension modules were skipped which
would break imports of 3rd party modules that used compiled extensions
if it was installed in a Python environment located inside a collection.

* Fix up pkg logic

* Added integration test

* Add newline to alias file

* Update lib/ansible/utils/collection_loader/_collection_finder.py

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>

---------

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2026-07-14 12:32:43 -07:00
Sloane HertelandGitHub 3217c352bb fix async timeout message that the async task produced unparsable results (#87138)
ci_complete
2026-07-14 17:07:32 +02:00
Sloane HertelandGitHub 901b834c8d Fix detecting (and by extension retrying) IncompleteRead when downloading collections (#86025)
Add type hint
2026-07-14 09:13:49 -05:00
sivel / Matt MartzandGitHub 8d63341579 Include origin in error for invalid config choice (#87170)
* Include origin in error for invalid config choice
2026-07-08 22:08:33 +00:00
sivel / Matt MartzandGitHub 1e511b5174 Install runc on fedora if installing docker (#87229) 2026-07-08 11:15:40 -05:00
Martin KrizekandGitHub 0e69d86c0c free: only block a host before queueing a task (#86660)
Fixes #86656
2026-07-01 16:33:05 +02:00
Abhijeet KasurdeandGitHub 78c337b827 encrypt: fix bcrypt salt string formatting (#87184)
* fix bcrypt salt string formatting on musl libc by ensuring it is always zero-padded to 2 digits

Fixes: #87180

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-06-30 10:08:31 -04:00
Lee GarrettandGitHub 305ead5130 integration test unarchive: Only install language pack on Ubuntu (#87130)
The language packs are an Ubuntu-specific packaging. On Debian systems
(and derivatives) these packages don't exist and the language files are
installed by default with the package (as confirmed with `apt-file
search tar.mo`)
2026-06-27 08:45:00 -07:00
Martin KrizekandGitHub 1c67ac43aa SSH_ASKPASS: inspect SSH_ASKPASS_PROMPT for reliability (#86814)
Fixes #86319
2026-06-26 07:50:48 +02:00
Patrick KingstonandGitHub 47b7738e63 Fix inject facts deprecation warnings in setup_deb_repo (#87132) 2026-06-25 03:25:49 -07:00
1378412a9e Deconstruct AGENTS.md to context dir (#87162)
* Deconstruct AGENTS.md to context dir

* Split guidelines applicable to both humans and agents to top-level `context` dir.
* Instruct agents to read all context files for now- piecemeal/just-in-time context ingestion has been spotty and problematic to date.

Co-authored-by: Matt Clay <matt@mystile.com>
Assisted-by: Claude

* update package-data sanity to ignore context

* markdown line length sanity

* Ignore context dir in change detection

* Remove core plugin deprecation instructions

* Inconsistent with published docs and docsite behavior- resolve those first.

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2026-06-24 18:11:13 -07:00
Matt ClayandGitHub ee8c66486c ansible-test - Update base/default containers (#87169)
Images now include Python 3.15.0b3.
2026-06-24 15:47:24 -04:00
Matt ClayandGitHub 6922432ecd Support frontmatter in pymarkdown sanity test (#87164)
* Fix formatting of skill markdown

* Support frontmatter in pymarkdown sanity test

* Allow .github/ to use frontmatter
2026-06-24 11:12:00 -05:00
Matt ClayandGitHub 9cc7281c69 ansible-test - Update RHEL remotes (#87120)
* ansible-test - Update RHEL remotes

* Include packaging in RHEL bootstrapping

This is needed for the Ansible pip module to function in the absence of setuptools.
2026-06-24 11:56:04 -04:00
Matt ClayandGitHub 925f5fb1e6 Add missing ignore for selilnux test (#87167) 2026-06-24 11:43:30 -04:00
Tomáš HrnčiarandGitHub 00618a2c95 Fix test compatibility with pytest >= 9.1 (#87165)
Pytest 9.1 fixed parametrize to correctly unpack single-element tuple values when using a string argnames with a trailing comma (e.g. "arg,"), treating it like the tuple form ("arg",) (pytest-dev/pytest#719).
This causes test_missing_lchmod_is_link_in_sticky_dir to fail because the trailing comma in @pytest.mark.parametrize('stdin,', ...) now makes pytest try to unpack {} as a sequence, finding 0 elements for 1 name.

Remove the spurious trailing comma from 'stdin,'.

Assisted-by: Claude Opus 4.6
2026-06-24 08:25:02 -07:00
Sloane HertelandGitHub 3d3afdb34b async_wrapper - fix race condition writing timeout result to job file (#87090)
The async_wrapper now stops the module process before writing the timeout result to the async job file. This ensures a valid JSON file that async_status can parse.

Improve gather_facts parallel=true timeout responsiveness when gather_timeout is less than 10.

Fix integration tests.
2026-06-23 10:14:21 -04:00
Matt ClayandGitHub b475463834 Fix field names in exception messages (#87079) 2026-06-16 13:36:28 -04:00
Matt ClayandGitHub 25ebd3d0f5 Fix fold deserialization on tagged time/datetime (#87080) 2026-06-16 13:34:05 -04:00
David ShrewsburyandGitHub d772fe65b7 Use errno symbol instead of hardcoded value in wait_for (#87087) 2026-06-11 11:31:41 -04:00
Matt ClayandGitHub 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 ShrewsburyandGitHub 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 HertelandGitHub 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 ClayandGitHub 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
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 ClayandGitHub 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 KasurdeandGitHub 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 MartzandGitHub 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 GandGitHub 1b31d6c3f1 Fix comma-splice in include_vars documentation (#87055) 2026-06-05 08:57:25 -04:00
Matt ClayandGitHub 147ca90b27 Fix deprecation message typo for get_platform in basic.py (#87065) 2026-06-05 07:17:25 +00:00
Abhijeet KasurdeandGitHub 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 ClayandGitHub 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 KasurdeandGitHub 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 VuandGitHub 2a628c04c9 user: fix Alpine move_home ordering (#87044) 2026-06-02 04:40:30 -07:00
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 (Святослав Сидоренко)andGitHub 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 MartzandGitHub 73f4bdb681 Add ai context skill (#87038) 2026-05-28 10:22:12 -05:00
Matt ClayandGitHub ba21909655 Update AZP container (#87010) 2026-05-27 19:29:13 -07:00
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 MartzandGitHub 28dadef725 Update skills for compat with non-claude agents (#87032) 2026-05-26 17:40:34 +00:00
Matt DavisandGitHub 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