* 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.
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>
* 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
When using sshpass the file descriptors leaks would happen in the reset
method that used _build_command that creates the pipe but the command
would not go through _bare_run which closes the pipe.
Another scenario would be _bare_run failing and not all code path would
properly close the pipe.
This patch fixes the issues by:
* move creating the pipe from _build_command closer to where it is used
in _bare_run
* wrap _bare_run with closing the pipe in case of a failure
* no need to re-create pipe in the retry code
* unrelated but simplify the reset method
* copy: honor directory_mode when specified with remote_src=True
* Honor directory_mode specified by user when copying directories
and remote_src=True
Fixes: #81292
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
* Support configuring callback plugins with --extra-vars
Callback plugins define variable names in the documentation for ConfigManager
Variable values can be omitted
* Added default callback variable configuration for display_skipped_hosts
Fixes#84469
Co-authored-by: Matt Clay <matt@mystile.com>
* GNU digest line may contain multiple spaces between
checksum and filename. Fix regex to handle this situation.
Fixes: #86132
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>