* 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
* 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
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.
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.
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.
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>
This is a fix for a common issue where Ansible is setting the LIB env var to the data type (System.Collections.DictionaryEntry) and not the actual value.
It unfortunately causes downstream issues if you run PowerShell scripts that are affected by the LIB variable not being a search path, but an incorrect string. It causes Add-Type to fail on even the simples call (like `Add-Type "using System;"`
Fixes an issue where the user module would create the /nonexistent directory when modifying a user to add them to a group on FreeBSD. The /nonexistent path is a standard convention for system accounts on FreeBSD that should not exist physically on disk.
This commit adds a check in the FreeBsdUser.modify_user() method to skip home directory creation when the home path is /nonexistent.
Fixes#86368
Co-authored-by: zykov <zykov@biocad.ru>
* Consider the timezone offset while creating timestamp from `zipinfo -T`
information. This information is required while comparing to mtime of the file
on local filesystem (for idempotency purposes).
Fixes: #85779
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
This commit validates changes in a shallow clone git repo and shows
a diff for combined check and diff mode in case if any old single
full commit sha is provided in version parameter instead of any
branch name or HEAD together with refspec parameter.
At present, if an old commit sha is provided to version parameter
for a shallow clone git repository initially cloned using depth: 1
and if ansible-playbook is executed with --diff --check together,
the command shows:
Failed to get proper diff between <before_sha> and <after_sha>
fatal: bad object <after_sha>
One has to look into the examples to realize the generaed UUID is a UUIDv5.
As of today, `to_uuid` returns a UUIDv5. Document it.
Link: f2357cdc53/lib/ansible/plugins/filter/core.py (L338-L346)
Signed-off-by: Ariel Otilibili <a.otilibili@instadeep.com>
* ansible-galaxy - Change error to warning when no paths exist
When listing collections, a warning is much more appropriate than an error
for missing paths.
* winrm - Add better Kerberos error
Adds a better error when Kerberos authentication is requested but the
`pykerberos` library is not installed. This also removes the fallback to
basic auth if the username is in the UPN format and no transport/auth
method is specified. This is because a UPN user must be a domain account
and domain accounts cannot be used with basic auth.
* Add more docs about user settings
* Fix some grammar issues