Commit Graph
55353 Commits
Author SHA1 Message Date
Matt ClayandGitHub dfdada96d7 ansible-test - Add support for GitHub Actions (#86643) 2026-03-13 10:17:46 -07:00
Jordan BoreanandGitHub 51d5a456ef Fix powershell method on non-pipelined conns (#86619)
Fixes the action plugin mkdtemp and expand_user calls to fallback to the
original non-pipelined variants when a connection plugin does not
support pipelining. For example a 3rd party Windows connection plugin
may not support pipelining and thus cannot use the user _mkdtemp2 and
_expand_user2 variants exposed by the `powershell` shell plugin as they
require data to be sent over stdin.
2026-03-13 06:25:25 +10:00
Sloane HertelandGitHub 895481957b Fix issue templates - replace relative links with absolute links (#86640) 2026-03-12 10:48:24 -04:00
f201e921df user: Updating doc with gid in file module (#86635)
Signed-off-by: remz42 <remi.moncel@gmail.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+shertel@users.noreply.github.com>
2026-03-11 19:19:11 +00:00
36e318dfe9 file: Warn module lacks permissions (#86608)
* Raise warning on inaccessible path (#57573)

* Raise error on permission denied (#57573)

* Use `os.lstat` for all state operations in `file`

* Update warning messages

* Update changelog

* Make tests use remote_tmp_dir for easier cleanup

* Rename and update changelog fragment

* Tweak changelog fragment

---------

Co-authored-by: Jakub Pieńkowski <8525083+Jakski@users.noreply.github.com>
2026-03-11 12:16:25 +00:00
a8003fe732 Clarify ansible-galaxy changelog fragment (#86626)
Co-authored-by: Don Naro <dnaro@redhat.com>
2026-03-09 20:58:00 +00:00
Patrick KingstonandGitHub 0183e386df Sanity test for trailing newlines (#86625) 2026-03-05 19:35:52 -08:00
b1323f3ab1 ansible-galaxy - only install/download collections which support ansible-core by default (#86183)
* ansible-galaxy - only install/download collections with compatible requires_ansible metadata

inject requires_ansible as a dependency of the collection

add a hack to preserve the collection origin in the error message in get_dependencies and find_matches

* yield requires_ansible requirement before dependencies

* Fix error handling and broken test

Fix getting requires_ansible dependency after the metadata is available

Allow 3rd party servers to provide this metadata lazily for individual versions

Rename the candidate attr name for the error handling hack

* fix diff

* clarify code comments

refactor a bit

* Don't duplicate error message. Before:

[ERROR]: Failed to resolve the requested dependencies map. Could not satisfy the following requirements:
* ns.col2:1.0.0 (dependency of ns.col3:1.0.0) requires ansible-core <2.19.1
Hint: To disregard whether the collection supports the current version of ansible-core, configure COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCH as "ignore".
Hint: Pre-releases hosted on Galaxy or Automation Hub are not installed by default unless a specific version is requested. To enable pre-releases globally, use --pre: [RequirementInformation(requirement=<ansible-core:<2.19.1 of type 'requires_ansible' from Galaxy>, parent=<ns.col2:1.0.0 of type 'galaxy' from cmd_arg>)]

Failed to resolve the requested dependencies map. Could not satisfy the following requirements:
* ns.col2:1.0.0 (dependency of ns.col3:1.0.0) requires ansible-core <2.19.1
Hint: To disregard whether the collection supports the current version of ansible-core, configure COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCH as "ignore".
Hint: Pre-releases hosted on Galaxy or Automation Hub are not installed by default unless a specific version is requested. To enable pre-releases globally, use --pre.

<<< caused by >>>

[RequirementInformation(requirement=<ansible-core:<2.19.1 of type 'requires_ansible' from Galaxy>, parent=<ns.col2:1.0.0 of type 'galaxy' from cmd_arg>)]

After:

[ERROR]: Failed to resolve the requested dependencies map. Could not satisfy the following requirements:
* ns.col2:1.0.0 (dependency of ns.col3:1.0.0) requires ansible-core <2.19.1
Hint: To disregard whether the collection supports the current version of ansible-core, configure COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCH as "ignore".
Hint: Pre-releases hosted on Galaxy or Automation Hub are not installed by default unless a specific version is requested. To enable pre-releases globally, use --pre.

* appease CI

fix type hints

* Update changelogs/fragments/install-ansible-core-compatible-collections.yml

Co-authored-by: sivel / Matt Martz <matt@sivel.net>

* Hardcode unsupported requires_ansible version to make maintaining the tests easier

Add a test for failed backtracking

Co-authored-by: sivel / Matt Martz <matt@sivel.net>

---------

Co-authored-by: sivel / Matt Martz <matt@sivel.net>
2026-03-05 11:08:51 -06:00
948f8f42d0 Configurable vaulted value rendering (#86561)
* Fix vaulted value rendering

- Fixes AnsibleDumper works on vaulted strings
- Adds config setting for opting in to future forced-strictness

* Add tests for new to_yaml functionality

* Add return on all paths

* Clarify configured value name

* Fix sanity (remove unused import)

* Catch more cases of encrypted strings

* WIP fix failing unit tests

* Update unit test to work with new to_yaml features

* Remove unit test

Running coverage with/without shows no new coverage.

* Write some basic error text

* Fix tests for error configuration

* Change names

- Change `vault_behavior` to just `vault`
- Change `preserve` to `keep_encrypt`

* Fix small issues in tests

* Fix fmt with black

* Fix unit tests

- Fix imports
- Fix the name of the param

* Update assorted docs - code review

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Remove deprecation

* Simplify vault parameter and handling

- Get rid of `default` enum
- Get rid of config option and associated test file
- Change `vault` to `vault_behavior`

* Document filter parameter

* Correctly Document filter parameter

* Add version_added and changelog fragment

* Tweak changelog

* Remove dead code, add docstring

* Add bugfixes section to changelog

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2026-03-04 14:30:49 -08:00
David ShrewsburyandGitHub 2341354ffa Replace gpg in rpm_key with librpm (#86237)
* Replace gpg in rpm_key with librpm

* Manually compute primary key ID and fingerprint for older librpm

* Code cleanup

* Add some v6 tests

* Add rhel 10.1 to CI matrix and changelog

* Remove RHEL 10.0

* consolidate common code and rename unused vars

* remove unnecessary exception raise

* Fix return type

* review comments: change import and use of Optional

* ci_complete ci_coverage

* address review comments

* When checking for existing keys, account for short from key ID and revert test change that hid this

* Support RPM version 6+. Allow 'key' to be fingerprint.

* Replace v6 test key with non-PQC algo version and enable Fedora v6 tests

* modify changelog, mod doc, and del 10.1 test req

* Code refactor and new tests

Refactor code to not need to use librpm API to get list of installed
keys. Also add new tests to verify deleting by fingerprint.

* Refactor drop_key() by rpm version, fully type hint code

* use hexdigest()
2026-03-03 16:57:17 +00:00
9970893084 Add PowerShell 7 support (#85796)
* Add PowerShell 7 support

Add support for running PowerShell modules cross platform and with
PowerShell 7. Tidies up some PowerShell shell plugin methods to make
it more reflective of the target shell vs a shell used for Windows.

Currently only Windows is officially supported with a plan on adding
tests and official support for non-Windows platforms at a later date.

ci_complete

* Fix pslint sanity issues

* Fix up typos

* Update lib/ansible/plugins/connection/psrp.py

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

* Add note about relative symlink

* Use TracebacksFor instead of Verbosity for debug info

* Use proper powershell name in CI script

* Remove extra ansible-test changes leftover from rebase

---------

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2026-02-28 18:25:26 +10:00
Matt DavisandGitHub 9183809c3e add missing changelog for 86601 (#86604) 2026-02-28 01:20:22 +00:00
Matt DavisandGitHub a287389124 Fix network module failures on tagged RPC responses (#86601)
Fix network module failures on tagged RPC responses

* Zap tags in networking JsonRpcServer before pickling responses.
* Verify with unit test - suboptimal, but avoids a fake network connection plugin.
2026-02-27 17:08:45 -08:00
Matt ClayandGitHub e82d9564f0 Fix libxcrypt test setup on macOS 26.3 (#86598) 2026-02-26 03:36:55 +00:00
Jordan BoreanandGitHub 8e9ce75266 Fix up TLS settings for pwsh bootstrapping (#86594)
On some Windows hosts the TLS policies don't allow TLS 1.2 or newer by
default. We add some code to the bootstrapping code to enable PowerShell
to use the OS policies rather than the outdated .NET ones.

This has only appeared on Azure 2016 based hosts, AWS on 2016 seems to
configure the server to use the OS policies some other way. 2019+ by
default aren't affected.
2026-02-25 09:11:33 +10:00
Matt ClayandGitHub 8a07f8963d ansible-test - Improve git submodule error handling (#86586)
Also fix `env --list-files` to ensure non-filename output is sent to stderr.
2026-02-24 10:10:54 -08:00
Matt ClayandGitHub 87265284fa ansible-test - Fix pslint powershell selection (#86593)
This was overlooked in https://github.com/ansible/ansible/pull/86238
2026-02-24 17:52:53 +00:00
Abhijeet KasurdeandGitHub a751010bea package_facts: Use apk query instead of apk info to gather facts (#86581)
* package_facts: Use apk query instead of apk info to gather facts

* ``apk query`` gives more options to gather facts than ``apk info``

Fixes: #86579

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-02-24 10:27:45 -05:00
Abhijeet KasurdeandGitHub a44218e4b1 user: fail if groups is not provided with append (#86573)
* Update documentation

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-02-24 10:14:07 -05:00
Matt ClayandGitHub fbe9d7f32a ansible-test - Fix traceback on multiple win remotes (#86591) 2026-02-24 01:56:00 +00:00
Matt ClayandGitHub 4ae2ccbc8f ansible-test - Support pwsh version selection (#86238)
Although this change exposes `ansible_pwsh_interpreter` in inventory generated by ansible-test,
a follow-up change is needed to enable its usage.
2026-02-23 15:35:33 -08:00
cc2f35da5b default callback: add display_included_hosts option (#85758)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2026-02-23 16:16:47 +00:00
52b7d4d092 user: return actual system groups instead of input parameter (#86553)
The user module's 'groups' return value was returning the groups
specified in the module input rather than the actual groups the
user belongs to on the system. When using append=true, this meant
pre-existing groups were missing from the output.

Now queries the system for the user's actual group membership after
modification, which matches the documented behavior of "List of
groups of which the user is a member."

Fixes #80669

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 09:40:55 -05:00
Matt ClayandGitHub 7d281b2a7c Fix YAML string loading using Python loader (#86421) 2026-02-19 16:16:44 -08:00
Alexei ZnamenskyandGitHub f97d555247 find: adjust docs (#86554) 2026-02-19 14:32:27 -05:00
Abhijeet KasurdeandGitHub cdeea95a46 ansible-galaxy: handle an error when invalid regex specified (#86546)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-02-19 14:09:28 -05:00
Patrick KingstonandGitHub 7fdac45993 Fix freebsd user integration test repeatability (#86542)
* Cleanup previous user creations
2026-02-19 14:08:43 -05:00
d6f719429b Docs: Clarify user module behavior for invalid password hashes (#85838)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2026-02-17 12:45:23 +00:00
Brian CocaandGitHub 8730acbb2d config lookup, fallback to existing constants when needed (#86516) 2026-02-16 13:44:02 -05:00
be09a21446 Disable detached head warning on collection checkout (#86170)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2026-02-11 16:47:33 +00:00
Ariel OtilibiliandGitHub 130e00736e executor: Remove RETURN_VARS (#86527)
RETURN_VARS was introduced for #70331, and last used in #70853.

    # git grep RETURN_VARS | wc -l
    1

Remove it.

Signed-off-by: Ariel Otilibili <a.otilibili@instadeep.com>
2026-02-10 15:06:07 -05:00
cf28bcb65d apt: Add deb822_repository in seealso section (#86539)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2026-02-10 07:16:09 -08:00
Abhijeet KasurdeandGitHub 0a2bac10da first_found: ensure lookup under files directory (#85669)
* Make sure to look under files directory when no path is specified.

Fixes: #85655

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-02-06 13:21:34 -08:00
Sam DoranandGitHub 475806a573 user - Preserve current password when modifying user on BusyBox systems (#86530)
* user - Preserve current password when modifying user on BusyBox systems

A bug in _build_password_string would incorrectly change the password hash
to ‘*’ if no password was specified.

* Update tests

Add a task to unsure the password is preserved when the password is not specified.

Use correct value when inspecting the password hash from the shadow data.

* Add changelog
2026-02-06 11:04:57 -08:00
Sam DoranandGitHub 34b0923967 Fix user modification on Alpine (#86143)
Fix user modification on Alpine. This change will handle primary group, shell, and password changes. It does not handle expiration changes, though it probably could with a bit more work.

The Alpine documentation recommends manually editing /etc/password to change the shell. These changes will rewrite the /etc/passwd file using atomic_move but creates a backup beforehand.
2026-02-05 11:09:51 -05:00
Abhijeet KasurdeandGitHub 03776e3bef config: Correct config in COLLECTIONS_PATHS (#86514)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-02-04 13:28:19 +00:00
Martin KrizekandGitHub d9deb945b0 async_status: inherit delegate_to from original task (#86493)
Fixes #86491

ci_complete
2026-02-04 09:39:42 +01:00
Matt ClayandGitHub 7f17759bfe Integration test updates for PowerShell support (#86519)
Minor test additions/updates to prepare for improved PowerShell support in ansible-test.
2026-02-03 17:08:59 -08:00
Abhijeet KasurdeandGitHub 66a9e19010 get_url: reword checksum description (#86507)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-02-03 16:36:00 +01:00
Mohammed Saalim KandGitHub 2f621c95fd deb822_repository: validate name parameter instead of over-normalizing (#86494)
* deb822_repository: validate name parameter instead of over-normalizing

The deb822_repository module was silently mangling the name parameter by converting to lowercase, replacing underscores with hyphens, and removing other characters. This caused filename collisions where distinct repository names produced identical filenames.

This change validates that the name parameter contains only valid APT sources.list filename characters (a-zA-Z0-9_.-) and preserves the name as-is. Invalid characters now result in a clear error message.

Fixes: #86243

* fix: update install.yml test to use valid name without spaces

* deb822_repository: add backward compatibility for legacy filenames

Check if a file with the old normalized naming convention already exists before using the new naming. If a legacy file exists, reuse that slug to avoid creating duplicate files for the same repository.

This addresses feedback from #86343 to maintain backward compatibility.

* deb822_repository: adopt PR #86343 approach for backward compatibility

Based on maintainer feedback, removed strict validation that hard-failed on invalid characters. Instead:

- Convert spaces to hyphens (backward compatible with existing playbooks)

- Preserve case, underscores, and periods

- Check for legacy-normalized files and reuse them if they exist

This maintains backward compatibility while still avoiding over-normalization.

Addresses feedback from https://github.com/ansible/ansible/pull/86494#discussion_r1975816493

* Replicate PR #86343 structure and fix trailing whitespace

- Created name_handling.yml with exact tests from #86343

- Import name_handling.yml in main.yml

- Removed conflicting tests from test.yml

- Updated changelog to match #86343 format

- Fixed trailing whitespace on line 584 (pep8/pylint fix)

* Apply suggested change: inline name.replace() directly
2026-02-03 16:21:45 +01:00
Patrick KingstonandGitHub 1e31c7c819 Fix ansible-galaxy collection metadata/file system location discrepancy (#86402)
* Fix discrepancy between ansible-galaxy and ansible runtime when identifying usable collections

When enumerating usable collections, ansible-galaxy validates the galaxy metadata in the MANIFEST.json/galaxy.yml matches the collection path.

When the metadata is incorrect ansible-galaxy emits a warning and falls back to using no metadata since it is not required for usable collections.

* ansible-galaxy collection verify now evaluates the collection that will be used at runtime, even if a collection inaccurately documents the same namespace and name earlier in the search path

* Add integration tests for ansible-galaxy collection verify, list, and install
2026-02-02 17:17:36 -05:00
Jordan BoreanandGitHub 20ce7d60bd Align AddType debug info with DISPLAY_TRACEBACKS (#86506)
Changes the logic used by `Ansible.ModuleUtils.AddType` to only include
the debug information when `DISPLAY_TRACEBACKS` is set to `error` or
`always`. This aligns with the new logic that no longer uses the
verbosity level to include extra traceback information with higher
verbosities.
2026-02-03 04:26:05 +10:00
Jordan BoreanandGitHub 2c1fdfe0eb Action make_tmp_path fix error (#86505)
Fixes the error to only include the command rather than the dataclass
repr. This goes back to how it worked in the past before `_mkdtemp2` was
added.
2026-02-03 04:25:21 +10:00
David ShrewsburyandGitHub 90595736ed Fix local connection interaction with become plugins (#86473)
The local connection plugin is incorrectly passing a bytearray to methods of become plugins that expect bytes. A recent change to the su plugin exposed this by breaking the become plugin for different locale settings (the bytearray was not properly converted to a str for comparison operations). This changes the local connection plugin to send bytes.
2026-02-02 09:02:53 -05:00
Patrick KingstonandGitHub 29086acfa6 Fix git checkmode on invalid ref (#86348)
Fix the output of git checkmode when supplied with a nonexistent ref for the version parameter.
Uses git fetch --dry-run [ref] to check if the supplied ref actually exists.
2026-01-30 13:55:29 -05:00
Matt ClayandGitHub 7f7884fc4f ansible-test - Update spare-tire URL (#86477) 2026-01-29 09:53:58 -08:00
1036c096a2 Make relative links in the description field of core packaging metadata absolute
PR #86461.

Prior to this patch, the core packaging metadata contained relative contributing and license file URLs in its description field, which is sourced from the `README.md` file. These URLs are relative to the website location they're rendered in. On GitHub, they'd point to neighboring files in the repository but PyPI does not host them and this makes relative URLs point to addresses on PyPI that do not exist.

The change updates the lin URLs to be absolute and point to the file views in the GitHub repository, which fixes #86460.

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
2026-01-27 16:56:44 +01:00
Matt ClayandGitHub b1bc1e2513 Fix direct S3 link in integration tests (#86464)
Also add a sanity test to prevent similar issues in the future.
2026-01-26 15:25:51 -08:00
Matt ClayandGitHub c1ff53e21d ansible-test - Remove obsolete remote auth (#86462) 2026-01-26 11:02:53 -08:00
Matt ClayandGitHub ade3d2c3ff ansible-test - Update the Ansible Core CI endpoint (#86455) 2026-01-23 08:36:20 -08:00