* Enhance winrm connection failure
- Add winrm_hostname to the failure message for clarity
- Test that we're able to reach this message with a custom action plugin
* Create changelog fragment
* Make action plugin less verbose
* Remove more comments (they were bad)
* Upgrade coverage for Python 3.10+.
* Fix unit tests.
* Use ctrace to improve performance. It's unclear why this improves performance on Python 3.10 and 3.14.
* Add VALIDATE state to IteratingStates and FailedStates instead of overloading cur_regular_task, which marks the --start-at-task location.
fixes#86268
* Fix skipping validate_argspec by not tagging with 'always' when inheriting play-level tags. Now it aligns with play-level gather_facts tag usage.
* added the sorting of FILES.json based on name with ASCII2 ordering
* remove useless code
* Add comprehensive tests for FILES.json sorting to ensure reproducible builds
This commit adds tests to validate the FILES.json sorting feature implementation (issue #82792).
Unit Tests (test/units/galaxy/test_collection.py):
- test_build_files_manifest_sorted_by_name: Validates ASCII sorting
- test_build_files_manifest_walk_sorted_output: Tests walk function
- test_build_collection_reproducible_build: Ensures reproducibility
- test_build_files_manifest_special_characters_sorted: Edge cases
- test_files_json_has_sorted_keys: Validates JSON key ordering
- test_build_collection_large_number_of_files_sorted: Scale testing
Integration Tests (test/integration/.../build.yml):
- Multiple builds produce identical FILES.json
- Verify FILES.json reproducible across builds
- Verify all files in ASCII sorted order
- Validate FILES.json format and structure
- Verify each file entry has required fields
Per the comment that 'this should follow the same pattern as _build_collection_tar', add `sort_keys` to this invocation of `json.dumps`
Also removes a sort because files area already sorted in `_build_files_manifest`, which is the source of `file_manifest` in `_build_collection_dir`'s only invocation (line 1669)
Co-authored-by: Thomas Wang <yuanchen.wang@optus.com.au>
Co-authored-by: Thomas Wang <yctomwang123@gmail.com>
Co-authored-by: pvskp <pvincius14@gmail.com>
Currently when the editor returns a failure exit code in `ansible-vault edit`,
the original file is still being overwritten by whatever is in the temporary
file. This is undesirable when some process already made edits to the temporary
file and then later fails for some reason, since the file might only be
partially modified and thus corrupt.
Fix this by using `check_call()` instead of `call()` to throw an Exception when
the exit code is non-zero.
Co-authored-by: Matt Clay <matt@mystile.com>
* Register projections and action plugin variable API
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Patrick Kingston <pkingsto@redhat.com>
* While creating bare minimum container images, sometimes
/var/lib/apt/lists is removed.
Recreate this directory in order to update cache successfully.
Fixes: #61176
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+shertel@users.noreply.github.com>
* Simplify pipelining logic for Windows ci_complete
Has the Windows connection plugins override is_pipelining_enabled to
return True rather than use the special connection plugin attributes.
These attributes should be removed in the future but when is still
dependent on when we can expect Ansible 2.19 is the minimum version
supported in collections.
* Make CI green
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
---------
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
When editable is set to true, -e flag should be passed to all packages.
This change passes -e flag before each package name. However, if a
requirements file is used, then editable flag raises errors. Therefore,
editable and requirements are now mutually exclusive.
Fixes#77755
Signed-off-by: Nirmal Patel <nirmal@nirmal.dev>
* Add support for PowerShell modules on POSIX
Adds support for running modules written in PowerShell on non-Windows
hosts. This includes references to a PowerShell or C# module_util
located in Ansible or a collection. Not all module utils will work
outside of Windows but `Ansible.Basic` will do so.
Support for PowerShell modules on non-Windows is up to the module and
collection author. This PR just enables the ability to run them through
the existing PowerShell execution wrapper.
* Fix up sanity and unit tests, try and run in separate CI group
* Fix up powershell.sh group detection
* More sanity fixes
* More sanity fixes
* Ensure shebang is part of command to run
* Try and simplify exec module logic
* Attempt to get powershell group running in CI
* Fix up test integration aliases for powershell
* Remove ansible.windows collection for integration support
* Revert the win_powershell changes now they aren't needed
* Simplify test matrix and use default container
On platforms like Alpine and BusyBox, group delete operation
with force is not applicable. Raise an error notifying the
user about the same.
Fixes: #85565
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
* split the dnf module into a cli shim and a module
* Update package_facts to use rpm cli, add package_facts and rpm_key to rhel8 targeted testing
* Switch resource embedding to EmbedManager.embed API
Co-authored-by: Matt Davis <nitzmahone@redhat.com>
* 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
* 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>
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>