Commit Graph
55372 Commits
Author SHA1 Message Date
Sloane HertelandGitHub a51536f311 Fix using the server's validate_certs config when downloading (#86705)
* Fix using the server's validate_certs configuration when downloading collections

* Fix validate_certs for verify

There is no GalaxyAPI on the collection object for verify since it wasn't created via the resolver

Remove unit test - would need more convoluted monkeypatching

* Simplify ConcreteArtifactsManager.save_collection_source by passing 2 arguments instead of 6

* Consolidate ConcreteArtifactsManager instance attrs _galaxy_collection_cache/_galaxy_collection_origin_cache
2026-03-25 11:20:34 -05:00
sivel / Matt MartzandGitHub 03c851d681 Switch to new galaxy-ng container setup (#86623) 2026-03-24 13:40:43 -05:00
ef7b026f77 apt: Handle comma-separated packages from recommends (#86613)
* While installing local deb packages, consider comma-separated
  packages from recommends

Fixes: #86609

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+shertel@users.noreply.github.com>
2026-03-24 03:40:04 -07:00
e6b6f34144 Add new psrp options and change service default (#86638)
* Add new psrp options and change service default

Add new options to the `psrp` connection plugin to specify the profile
loading behaviour and a password to use for decrypting the certificate
authentication private key.

This also changes the `negotiate_service` default from `WSMAN` to `host`
to improve compatibility with Windows targets that may not have the
`WSMAN` SPN registered like domain controllers and align with the
defaults the native PowerShell PSRemoting client uses.

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

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

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2026-03-24 15:11:00 +10:00
Matt ClayandGitHub 02a65ab292 ansible-test - Update base/default containers (#86706) 2026-03-21 01:51:04 +00:00
7d2aa2a4c6 find: add locale encoding in err msg when none is given (#86641)
When the search fails, as expected, the following error is printed out:

    [...] Failed to read the file FILENAME due to an encoding error. current encoding: None (default determined by the Python built-in function "open")

Add locale encoding in error messages when none is given.

As well, this case is hit for decoding exceptions, not encoding ones.

Change the error message.

Add the corresponding tests, update documentation.

Link: https://docs.python.org/3/library/locale.html#locale.getpreferredencoding
Co-authored-by: Matt Clay <matt@mystile.com>
Signed-off-by: Ariel Otilibili <a.otilibili@instadeep.com>
2026-03-20 18:07:35 -07:00
Matt ClayandGitHub e65e27c38a ansible-test - Update sanity test requirements (#86701) 2026-03-20 23:39:04 +00:00
Matt ClayandGitHub 30940e2689 ansible-test - Update utility containers (#86700) 2026-03-20 21:42:39 +00:00
Matt ClayandGitHub 67ef70756c ansible-test - Upgrade macOS remote to 26.3 (#86699) 2026-03-20 12:44:39 -07:00
Matt ClayandGitHub b330f2a051 ansible-test - Upgrade FreeBSD 14.3 to 14.4 (#86698)
Also use packaged version of ``packaging`` for FreeBSD 15.0.
2026-03-20 11:23:14 -07:00
Brian CocaandGitHub 4fdeac0a72 ssh connection, document quoting (#86684)
also move to fstrings
moved to case/match
2026-03-19 19:02:19 -04:00
Brian CocaandGitHub 85918854b3 note on pickle (#86685) 2026-03-19 19:01:41 -04:00
60a9be7f46 Consult deprecation metadata for non-collection builtins (#86689)
* Consult deprecation metadata for non-collection builtins

* Re-homed `ignore_deprecated` on PluginLoadContext
* Added tests

* remove superfluous shebang and ignore entry

* Apply suggestion from @mattclay

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2026-03-18 21:59:47 -07:00
Jordan BoreanandGitHub e091045923 Bump PowerShell 7.6 to GM release (#86688)
* Bump PowerShell 7.6 to GM release

* Update test container references
2026-03-19 07:10:54 +10:00
1d16ef3334 user: warn when seuser is set on systems without SELinux (#86671)
When the seuser parameter is provided but SELinux is not enabled on the
target system, the parameter is silently ignored and the module reports
changed: true. This misleads users into thinking SELinux user mappings
were applied.

Emit a warning when seuser is set and SELinux is not enabled, so users
are aware the parameter has no effect. This uses module.selinux_enabled()
to check at runtime rather than checking the platform type, as recommended by the maintainers.

The warning alone is not enough — useradd still receives the -Z flag
and fails with "useradd: -Z requires SELinux enabled kernel". Skip
adding -Z to the command when SELinux is not enabled.


Fixes #85542


---------

Co-authored-by: olegnazarov23 <olegnazarov23@users.noreply.github.com>
2026-03-18 08:30:40 -07:00
Abhijeet KasurdeandGitHub 80ee6b5d92 apt_repository: Deprecate module (#86090)
* Deprecate apt_repository in favor of deb822_repository

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-03-16 15:19:35 -07:00
c93085eece service: Add compatibility with GNU Hurd (#86622)
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-03-16 05:25:20 -07:00
Matt ClayandGitHub 3f10c2c0a9 ansible-test - Switch macOS remote to aarch64 (#86653) 2026-03-13 21:20:08 -07:00
Matt ClayandGitHub 3300932a74 ansible-test - Add managed test environment aliases (#86592) 2026-03-13 18:42:21 +00:00
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