55257 Commits

Author SHA1 Message Date
Matt Clay
58bad71859 Move display internals into _internal (#85889) 2025-09-22 16:07:10 -07:00
Chris Meyers
79ddee15a0 Prevent IO capture hang/loss in basic.run_command (#85869)
* Prevent run_command output truncation or hang

In cases when the selector used to monitor stdout/stderr activates without
data ready to read (a rare but normal condition), a read from a non-blocking
FD can return `None`, which was being conflated with an empty read (EOF)
condition. This caused the selector to be unregistered prematurely,
sometimes resulting in truncated output or hangs. `None` read results
are now excluded from EOF conditions.

* add changelog

---------

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2025-09-19 16:56:21 +00:00
Sloane Hertel
27a56a34df Add feature preview play argument spec validation (#85763)
* Add new play keyword validate_argspec

Set to True to use the play name as the argument spec identifier. A play name is required (i.e. a host pattern is not supported as an argument spec name).

Alternatively, set to a specific argument spec name.

A valid argument spec for the play is required. Example:

# playbook.meta.yml
argument_specs:
  name of the play:
    options: {}

* Play argument spec validation runs after fact gathering

Play keywords like tags are inherited and work similarly to fact gathering
2025-09-18 15:13:07 -04:00
Brian Coca
c87dc6ed7d script inventory plugin correct error message (#85765)
type was reflecting 'converted' type, not 'pre conversion' of the data
now message points at specific data keys
add deprecation tests
2025-09-17 09:59:37 -04:00
Sloane Hertel
43bb87107d Remove 'usage' parameter from CLI.init_parser and ansible.cli.arguments.option_helpers.create_base_parser (#85859)
The usage is generated from CLI arguments
2025-09-16 08:16:25 -07:00
Sloane Hertel
5e8815b823 Fix ansible-doc -l/-F/--metadata-dump for relative imports in filter/test plugins (#85801)
* Add test for sidecar documentation for filter plugin in a subdirectory

Fix ansible-doc --list/--list_files/--metadata-dump for relative imports in nested filter/test plugin files
2025-09-15 18:15:55 -04:00
Sloane Hertel
ced362a50d ansible-galaxy - remove deprecated v2 API (#85830)
* ansible-galaxy - remove deprecated v2 API

Update unit tests exercising the v2 Galaxy API

Remove v2 API integration tests

* Remove internal test configuration for servers which support API v2 and v3

* Update and simplify verify tests by using the configured server list
2025-09-15 17:29:12 -04:00
Ben Buchwald
e30da51731 Fix jsonfile cache on WSL (#85816)
On WSL, `os.rename` can't correctly move a file while a handle to that file is still open. It remains half-moved where neither the source or destination seem to exist (according to `os.path.exists`). However the move seems to complete correctly when the open handle is closed.

In `BaseFileCacheModule`, when writing a cache file, a temporary file is created with `mkstemp` that returns an open file descriptor and a filename. Once the cache is written to that file, it is renamed to the correct file name with `os.rename` and then its permissions set with `os.chmod`. On WSL the `os.chmod` fails because it doesn't think the file exists yet because the file descriptor returned by `mkstemp` is still open. This PR fixes this by closing that file descriptor before renaming.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-09-11 23:09:59 +00:00
Matt Clay
967d654ef6 ansible-test - More container updates. (#85843) 2025-09-11 15:56:14 +00:00
Matt Clay
9966e01f81 ansible-test - Update containers (#85842) 2025-09-10 17:32:20 -07:00
Ketan Kelkar
18691ec83f Replace module - update string comparison method from bytes to unicode (#85785) 2025-09-10 17:31:22 -05:00
Abhijeet Kasurde
cf9d78206c blockinfile: use line_separator variable (#85798)
* Future proofing the usage of line separator in blockinfile module.

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-09-10 19:27:34 +00:00
Matt Clay
d2940880ed ansible-test - Upgrade coverage to 7.10.6 (#85831) 2025-09-09 09:59:36 -07:00
Zdeněk Vydra
60511c2a08 Fix uri form-multipart to not overwrite filename to allow retries (#85010) 2025-09-09 16:09:28 +00:00
Matt Clay
ddbedc6ac6 Update mypy sanity test requirements (#85832) 2025-09-08 17:43:38 -07:00
Jordan Borean
eda1383da7 Remove deprecation marker that has been actioned (#85812) 2025-09-09 06:51:21 +10:00
Jordan Borean
250610b924 Remove tarfile data_filter check (#85808)
Removes the now uneeded tarfile check for data_filter now that our
minimum Python version on the controller is 3.12 and guarantees it will
be present.
2025-09-09 04:30:54 +10:00
Jordan Borean
aad9fbd4f5 Windows async - handle trailing junk output (#85820)
Add handling for when a PowerShell module emits more than just the
module result JSON. The behaviour reflects the Python async wrapper
where trailing data after the module result will emit a warning.
2025-09-09 04:30:38 +10:00
Matt Martz
df1da0419e Remove duplicate future import (#85824) 2025-09-08 12:26:47 -05:00
Abhijeet Kasurde
1cd4369815 fetch_file: add ca_path and cookies parameters (#85187)
* Added ca_path and cookies parameter arguments to fetch_file method
  to specify CA path and Cookies to fetch file from URL. These parameters
  are already supported by fetch_url.

Fixes: #85172

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-09-08 14:44:17 +00:00
Martin Krizek
065f202d30 Remove (de)serialize methods (#85724)
* move task specific from_attrs to Task
* Keep deserialize on PC, add tests
2025-09-08 09:24:08 -05:00
Patrick Kingston
36f00cdf1a Expand integration test coverage for deb822_repository module
PR #85586
2025-09-08 15:41:22 +02:00
Abhijeet Kasurde
975f60ebf9 encrypt: Remove deprecated passlib_or_crypt API (#85506)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-09-05 22:19:53 +00:00
Abhijeet Kasurde
a805356358 include_vars: Code cleanup and integration tests (#85292)
* Updated docs
* Removed stale code
* Added integration tests for better coverage

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-09-05 20:18:26 +00:00
Matt Clay
a25fd1021a ansible-test - Fix traceback on missing tmp dir (#85814) 2025-09-05 18:15:43 +00:00
Jordan Borean
f29d432c69 powershell - remove quoting logic (#85781)
Attempts to simplify the PowerShell code and special edge cases that
removes quotes from a value like a src or destination path on Windows
hosts. This should not be needed as paths should not be quoted when it
comes to this section of the code.

ci_complete
2025-09-05 11:21:58 +10:00
Jordan Borean
a345a404e0 shell - deprecates the wrap_for_exec API (#85782)
Deprecates the function `wrap_for_exec` on shell plugins. This is to
simplify the API and remove unecessary components that should live
elsewhere or have a better and more flexible API.
2025-09-05 11:21:18 +10:00
Jordan Borean
3582997698 Remove deprecated vars plugin fallback (#85809)
* Remove deprecated vars plugin fallback

Removes the vars plugin `get_host_vars` and `get_group_vars` fallback
which was deprecated.

* Remove integration tests for removed feature
2025-09-05 01:09:02 +00:00
Jordan Borean
94c78cb38f Removed deprecated DEFAULT_TRANSPORT smart option (#85810)
* Removed deprecated DEFAULT_TRANSPORT smart option

Removes the logic for handling `DEFAULT_TRANSPORT` set to `smart`.

* Remove unused import
2025-09-05 10:58:04 +10:00
Matt Martz
c59db5349e Add typing to to_text and to_bytes, improve typing and type juggling in DataLoader (#85746) 2025-09-04 18:57:35 -05:00
Felix Fontein
4209d714db validate-modules and return fragments: fix bug in markup check, fix bug in missing doc fragment check, add tests (#85638)
* Prevent crashing on invalid structure.

* Also process return doc fragments.

* Fix handling of missing doc fragments.
2025-09-03 21:52:22 +00:00
Felix Fontein
4c27ccf8f4 default callback: allow to configure indentation (#85497)
* Comment on PyYAML's behavior if indentation is set to 1, or to 10+.
2025-09-03 21:17:50 +00:00
Abhijeet Kasurde
d93f63ecfb apt_repository: Use correct debug method (#85786)
* Use self.module.debug method instead of non-existent
  self.debug method

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-09-02 16:09:32 -07:00
Sloane Hertel
0ed37ca899 setup - add logical volume facts scoped by volume group (#85705)
Add an 'lvs' key to each value in ansible_facts['vgs'] to support extracting all logical volume facts.

Add note to consider deprecating ansible_facts['lvs'] in a future release since it is misleading if any volume groups have identical logical volume names.

Fixes #85632
2025-09-02 13:30:03 -04:00
Abhijeet Kasurde
7b1644e0b3 dnf: Check if installroot is directory or not (#85748)
* dnf: Check if installroot is directory or not

* dnf library creates installroot if it is missing.
  check if installroot is directory or not.

Fixes: #85680

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-09-02 11:11:30 -04:00
Abhijeet Kasurde
a8dc3fae1e cron: misc fixes (#85733)
* removed elif in when return is used
* removed redundant module.exit_json

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-09-02 11:08:05 -04:00
Matt Clay
be9e57366b ansible-test - Update Ansible Core CI auth (#85717)
Implement new authentication methods for accessing the Ansible Core CI service.
2025-08-29 15:22:09 -07:00
Matt Clay
e8a3be9de5 ansible-test - Update sanity test and coverage requirements (#85761)
* ansible-test - Update sanity test requirements

* ansible-test - Update coverage to 7.10.5
2025-08-28 17:50:05 +00:00
Martin Krizek
6976e13075 ternary: evaluate values lazily (#85752)
Fixes #85743
2025-08-28 09:11:09 +02:00
Martin Krizek
b3ef4f7671 sanity: warn on ansible.module_utils.six imports (#85651)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-08-28 08:03:48 +02:00
Martin Krizek
3ec07418aa ansible-doc: remove displaying role attributes (#85725) 2025-08-27 08:05:11 +02:00
Trident101
14115afdb2 Remove excessive apostrophe (#85710)
Change:
The pkg_info‘ option was added in version 2.13.

To:
The pkg_info option was added in version 2.13.
2025-08-26 17:18:29 +02:00
Martin Krizek
5e78bc8eda vault/unvault filters: remove deprecated vaultid parameter (#85744) 2025-08-26 15:11:57 +02:00
Matt Clay
7b598f3fc9 CI - Add missing args to generic.sh (#85737) 2025-08-25 22:41:04 +00:00
Brian Coca
534b8c225a vars deprecation (#85673)
internal 'vars' dict cache has not been used for long time, but kept since we could not deprecate and some users had found it
2025-08-22 18:31:46 -04:00
Brian Coca
931c923e0e Deprecate defaulting to inject (#85323)
INJECT_FACTS_AS_VARS config deprecate default of true
2025-08-22 15:54:45 -04:00
Brian Coca
75ad1f8d6a tags warn wwhen using reserved tags (#85631) 2025-08-22 15:35:09 -04:00
Brian Coca
8b6446f2d5 Deprecate hash_params (#85630)
we stopped using it long ago, no plugin should be using it either, but JIC deprecate

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-08-21 16:56:16 -04:00
Martin Krizek
c5ddc93767 Expose ansible_failed_task in rescue for explicit flush_handlers (#85687)
Fixes #85682
2025-08-19 11:29:50 -04:00
Matt Davis
b1fc98c8ad Include result origin in broken conditional message instead of result (#85695)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-08-18 22:35:39 +00:00