Compare commits

...

655 Commits

Author SHA1 Message Date
Martin Krizek 7b4d4ed672
ssh connection: fix sshpass pipe fd leaks (#86141)
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
8 hours ago
Brian Coca 335db20951
vars loading, show file name instead of vars in error (#86277)
* Show file instead of vars on load error

(cherry picked from commit 490795770f34120adc02b08fc24fc50be6ac68a2)
(cherry picked from commit 11a2d02bf2)

* merged

* Update lib/ansible/vars/manager.py

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

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
22 hours ago
Sviatoslav Sydorenko 251fec31b4 🧪Drop PkgReq stub @ `ansible.galaxy.collection`
This tiny restructuring allows us to get rid of the type ignore.
2 days ago
lixiaoyong01 cc839f013a
Fix typos in apt_key module (#86257)
Co-authored-by: lixiaoyong <lixiaoyong@kylinos.cn>
1 week ago
John Eismeier a5a2b77911
Propose fix typo of targetting (#86242)
Signed-off-by: John E <jeis4wpi@outlook.com>
1 week ago
Abhijeet Kasurde 17f3698384
copy: honor directory_mode when specified with remote_src=True (#86184)
* 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>
1 week ago
Abhijeet Kasurde 5f2d96c60e
regex: fix example documentation for regex_test (#86172)
Fixes: https://github.com/ansible/ansible-documentation/issues/3246

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
1 week ago
sivel / Matt Martz 6bb7bd760f
Fix escaping issue in ansiballz wrapper for sitecustomize (#86236)
* Fix escaping issue in ansiballz wrapper for sitecustomize

* add clog frag
1 week ago
sivel / Matt Martz bff3a9aeb9
Fix docker hostname parsing in ansible-test (#86235)
* Fix docker hostname parsing in ansible-test

* add clog frag
2 weeks ago
Martin Krizek 9d9a8d78ee
Skip hostname integration tests on all container providers (#86227)
* Skip hostname integration tests on all container providers

* Use skip/docker instead
2 weeks ago
Thomas Sjögren 6d428ca8f0
replace random with secrets when generating passwords (#85971)
---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2 weeks ago
Matt Clay ce84d3157d
Fix first_found example (#86224) 2 weeks ago
Matt Clay 2797659df4
Use more stable platforms for agents examples (#86221)
Refer to versions that are changed less frequently in AGENTS.md to reduce the frequency of updates needed to keep it up-to-date.

Also fix a few spacing issues.
2 weeks ago
Sloane Hertel 7ebc9fa5d6
Support configuring callback plugins with --extra-vars (#84661)
* 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>
2 weeks ago
Abhijeet Kasurde af9009b00d
get_url: Fix regex for GNU digest line (#86134)
* 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>
2 weeks ago
Vinayak Bhatia e2ae13cf38
getent: Handle non-empty split string (#85728)
Signed-off-by: Vinayak Bhatia <ntpjc2vinayak@gmail.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
2 weeks ago
Patrick Kingston 76fb182b63
Fix pip package name resolution in check mode (#85623)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
3 weeks ago
Matt Clay 3d26431e4f
ansible-test - Improve AZP commit API error handling (#86197) 3 weeks ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) 69c9fbed26
Install `xt_comment` kernel mod @ `iptables` test (#86187)
This patch fixes integration test jobs running under RHEL 10.0 that
don't have this extension pre-installed.

Co-Authored-By: sivel / Matt Martz <matt@sivel.net>

ci_complete
ci_coverage
3 weeks ago
biancalana eb0ada3d28
Feature/improve bhyve guest and host detection (#85767) 3 weeks ago
David Shrewsbury dc3cc0f9ea
Fix test_encrypt.py unit test (#86180) 3 weeks ago
David Shrewsbury 83d2ce771c
Modify crypt library import pattern (#86120)
Hide the functionality of the _internal/_encryption/_crypt.py module
behind an object so that we don't have code executed at import time.
3 weeks ago
Patrick Kingston e0f61dfce4
Fix iptables match extension bug (#86147)
* Prevent unnecessary match extension duplicates

I moved this to use a set instead of the
`if not in rule` just in case there's a comment
like 'owner' or another stray string that matches
the extension.
3 weeks ago
Felix Fontein 13a7393cfe
Fix AnsibleModule.human_to_bytes (#85259)
* Fix AnsibleModule.human_to_bytes.

* Add unit test.

* Fix wrong example in docstring.

* Forgot tests without keyword.

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Apply review suggestions.

* Add type hints.

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
3 weeks ago
Felix Fontein 222f786f23
ansible-test validate-modules: report bad-return-value-key for return values that cannot be accessed with Jinja's dot notation (#86079)
* Report bad-return-value-key for return values that cannot be accessed with Jinja's dot notation.

* Move constants into separate module.

* Add test to check FORBIDDEN_DICTIONARY_KEYS against current Python's key list.

* Remove unused constant.

* Apply suggestions from code review.

Co-authored-by: Matt Clay <matt@mystile.com>

* Add type annotations.

* Simplify typing.

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Co-authored-by: Matt Clay <matt@mystile.com>
3 weeks ago
Matt Clay 76f07034b3
Fix unit test serialization (#86163)
This allows the test to work on pytest 9+
3 weeks ago
Felix Fontein 89ba882b08
runtime-metadata sanity test: ignore pre-release and build identifier (#85198)
* Ignore pre-release and build identifier.

* Add tests.

* Improve changelog fragment.

Co-authored-by: Matt Clay <matt@mystile.com>

* Extend tests.

---------

Co-authored-by: Matt Clay <matt@mystile.com>
3 weeks ago
Patrick Kingston 6a4b199054
Remove decrypt arg-docs mismatch (#86128)
* Remove decrypt arg-docs mismatch

Removes the use of the arg in the action plugin
and removes the associated doc fragment. Changes
no behavior because the lack of decrypt in the
argspec prevents a value being passed in and
the args.get('decrypt', True) means that it is
always true.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
4 weeks ago
Matt Clay 4184d9665e
Fix getuser fallback error handling (#86144) 4 weeks ago
sivel / Matt Martz 707a5ec617
Add CLAUDE.md/AGENTS.md files for tighter assistance with GenAIs (#85841)
* Add an override of the `/review` slash command in claude code
* Add support for `CLAUDE.local.md` and `~/.claude/ansible.md`

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
4 weeks ago
David Shrewsbury e3cff24134
Increase code coverage of utils/encrypt.py (#86060)
* Add encryption code coverage

Co-authored-by: Matt Clay <matt@mystile.com>
4 weeks ago
Matt Clay a4ae978122
template module - Report syntax error line number (#86101)
Report the line number for Jinja syntax errors in template files.
4 weeks ago
Matt Clay 8ac5c8580b
Remove urllib2 pylint check (#86139)
No supported Python version provides urllib2.
4 weeks ago
Matt Clay 5b8ae0b5b5
Fix deprecation comments (#86138) 4 weeks ago
Martin Krizek a2dda41bb6
Removed deprecated handle_stats_and_callbacks param of _load_included_file (#86063)
* Removed deprecated handle_stats_and_callbacks param of _load_included_file

Fixes #86003

* ci_complete
4 weeks ago
Iksas 388ce79fcd
apt: Stop the >= operator from being ignored while installing packages (#85254)
* apt: Stop the >= operator from being ignored if packages are not already installed

* apt: Fix failing integration test in Ubuntu 24.04
4 weeks ago
Abhijeet Kasurde 3c3a06b8fd
inventory: Add warning for invalid priority values (#86114)
* Handle ValueError raised when user set invalid priority values
* Update tests to work with Pytest

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Mannu Silva <wise.tent4987@fastmail.com>
4 weeks ago
Martin Krizek f743dfce93
basic.py: add proper deprecations (#86064)
* basic.py: add proper deprecations

* fix sanity
4 weeks ago
Jordan Borean 55e4ba224d
Raise min setuptools and remove wheel from build (#86040)
* Raise min setuptools for license specifier

Raises the minimum setuptools version used for our build requirements to
support the new license identifiers. This removes a deprecation warning
emitted by setuptools and will avoid breaking the build when the old
format is eventually removed.

* Fix typos referencing PEP 639 in text

The respective metadata docs are
* https://packaging.python.org/en/latest/specifications/pyproject-toml/#license
* https://packaging.python.org/en/latest/specifications/core-metadata/#license-expression

---------

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
4 weeks ago
Jordan Borean 829373bfb9
Use json for test inventory - ci_complete (#86118)
* Use json for test inventory - ci_complete

Uses the JSON/YAML format for the inventory files generated by
`ansible-test`. This solves minor issues with using complex values when
building the test inventory files like backslashes or more complex data
structures.

* Apply suggestions from code review

Co-authored-by: Matt Clay <matt@mystile.com>

* Add changelog and use more limited ext config var - ci_complete

---------

Co-authored-by: Matt Clay <matt@mystile.com>
4 weeks ago
Matt Davis 3c5bb535a9
Fix incorrect propagation of task.connection (#86121)
Co-authored-by: Matt Clay <matt@mystile.com>
4 weeks ago
Brian Coca 5904846342
config lookup, remove unreachable code (#86051)
defensive, but uneeded since get_option already precludes bad values
this far in
1 month ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) 730af3239d
🧪 Set timeouts for CI jobs
Sometimes, AZP would mark steps in jobs as cancelled when they've
actually exited successfully but on the boundary of the default
60-minute timeout. Such logs might be difficult to reason about.

Additionally, `entry-point.sh` sets a 60-minute timeout for the main
test invocation but it would never trigger earlier that AZP would kill
such a job as the job-global timeout was 60 minutes already and it'd
always be hit earlier than the test runner one.

The patch sets maximum observable job timeouts with extra buffer to
account for flakiness.

PR #86073

Co-authored-by: Matt Clay <matt@mystile.com>
1 month ago
Matt Clay 13496b9e11
ansible-test - Fix integration test code coverage (#86100) 1 month ago
Shion Ichikawa f2a4d6de12
🚨 fix yaml syntax error on ./test/integration/targets/unarchive/tasks/test_missing_binaries.yml (#86099) 1 month ago
Martin Krizek 2e8a859477
Remove deprecated imports from basic.py (#86065)
Fixes #85997
1 month ago
Matt Clay bb30a7fa1f
ansible-test - Update base/default containers (#86087) 1 month ago
Matt Clay 3bf54c8128
Remove obsolete incidental_ios_file test (#86086) 1 month ago
Matt Clay 12acd5c18f
ansible-test - Update sanity requirements (#86083) 1 month ago
Jason K Hall 8d07ed6318
Handle ValueError in run_command when parsing invalid args(shlex.split) (#85945) 1 month ago
Brian Coca d9d11d6ff6
sanitize path symbols in inventory_hostname on file cache plugins (#41420)
* File based cache plugins filenames fix

File based cache plugins will now correctly handle inventory_hostnames
with 'path symbols' in their names. This should allow those using
chroot and jail connection plugins to use file based caches now.
1 month ago
Abhijeet Kasurde 7bd2475a70
file, stat: return disk_usage_bytes (#85909)
Fixes: #70834

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
1 month ago
Brian Coca 169e6bead3
generated inventory plugin, add extra vars option (#85372) 1 month ago
Brian Coca 516a114ef6
option deprecations show alternatives (#86032)
Give users a helpful hint on what to do to address the deprecation
1 month ago
Sloane Hertel 68f5a7ca1c
Update issue templates with suggestion to exclude Galaxy server secrets and general reminder (#85481) 1 month ago
Patrick Kingston 087931546d
Remove deprecated safe_eval (#86019)
* Remove safe_eval from codebase

Resolves deprecations in 85996 and 85999

* Remove deprecations from sanity ignores

* Add changelog fragment

* Add newline to file

* Remove unused imports
1 month ago
Sloane Hertel df34bf9e70
Update win_exec_wrapper integration test to match #86029 (#86052)
* Remove assertion now that there is no warning
1 month ago
sivel / Matt Martz e4b4787c02
Soft deprecate ansible.module_utils.six (#86048) 1 month ago
Martin Krizek 6dd48814f2
Remove test/units/module_utils/compat/test_datetime.py (#86045)
Follow up on #86018
1 month ago
Abhijeet Kasurde ef53d63953
package_facts: typecast bytes to string while returning facts (#85939)
Fixes: #85937

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
1 month ago
Abhijeet Kasurde 367de4498b
module_utils: remove deprecated compat.datetime APIs (#86018)
Fixes: #86000

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
1 month ago
Abhijeet Kasurde 9a350ff104
git: removed deprecated gpg_whitelist alias (#86011)
Fixes: #86004

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
1 month ago
Abhijeet Kasurde 9f1177a056
Removed parameter 'required' from get_bin_path API (#86009)
Fixes: #85998

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
1 month ago
Abhijeet Kasurde 790b66f383
interpreter_discovery: removed auto_silent* option (#86006)
* interpreter_discovery: removed auto_silent* option

* Removed deprecated auto_silent* option from interpreter_discovery_python

Fixes: #85995

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Make CI green

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Make CI green I

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
1 month ago
Jason K Hall 192948434c
galaxy: handle missing 'results' key in cached Galaxy API responses. (#85972)
* galaxy: handle missing 'results' key in cached Galaxy API responses.

* galaxy: clarified AnsibleError message for missing cache results.

* Modified AnsibleError message and added a regression test.

* Fixed formatting issue in test/units/galaxy/test_api.py

* Added a changelog entry.

* Modified changelog.
1 month ago
sivel / Matt Martz d6051b18dd
Add support for crypt/libxcrypt via ctypes, as an alternative to passlib (#85970)
* Add support for crypt/libxcrypt via ctypes, as an alternative to passlib

* move verbosity message to BaseHash

* Don't require DYLD_LIBRARY_PATH mods for standard homebrew installs on macos

* improve crypt_gensalt error handling
1 month ago
sivel / Matt Martz f1f5b934c2
Update DataLoader to deal almost exclusively in str (#85941)
* Update DataLoader to deal almost exclusively in str

* source can be None as well

Co-authored-by: David Shrewsbury <Shrews@users.noreply.github.com>
1 month ago
Miro Hrončok 719681bbe2
Do not require wheel for building (#85533)
* Do not require wheel for building

- current version of setuptools (70.1+) does not need wheel at all
- older versions of setuptools would fetch wheel when building wheels (but not sdists)

* Pin setuptools to a version not requiring wheel

Now when we don't list wheel,
we are unable to pin it to a particular version.

Instead, use setuptools version that no longer uses it.
1 month ago
Brian Coca ccfb7b1364
Fix include_role error consitency and add rescueable option (#86012)
* include_role now behaves more like task on error

changes _from errors from syntax to task failures, by default
which makes it more consistent with other existing errors
 * also force 'missing role' to behave as syntax error when false
 * also error when subdir does not exist, previouslly we ignored missing
   file
 * add 'rescuable' toggle to allow user to chose error type

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
1 month ago
Brian Coca 1cb2932c95
config lookup, fix 'show_origin' and variables (#85356)
show_origin and variable sources were broken for base config when 'forked' from plugins
---------
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
1 month ago
Jordan Borean 99bb587906
Remove AddType warning for cleanup (#86029)
Removes the warning emitted when using Add-Type and the cleanup of temp
files fails due to a file still being in use. The cleanup should be
handled by AnsibleModule on exit giving it more time to wait for any
open file handles to close. The exception is still present if calling
`Add-CSharpType` without an `AnsibleModule` object.
1 month ago
Brian Coca 22721b5d63
Slurp armor option (#85986)
* slurp, add option to deactivate the armor

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 months ago
Sviatoslav Sydorenko 823c117563 Fix dry-run for notifications @ publish-codecov
Apparently `codecovcli send-notifications` does not have a `--dry-run`
CLI option. This patch stops adding it to the command and implements
an external `dry-run` mode in the wrapper script or this case instead.

This is a follow-up for #85968.

Co-authored-by: Matt Clay <matt@mystile.com>
2 months ago
sivel / Matt Martz 1a3e63c794
Don't deprecate six yet (#86020) 2 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) 2799a684fc
Explicitly notify Codecov about upload completion (#85968)
This patch add an additional invocation of Codecov CLI that tells the
backend that we're done uploading. It is supposed to stop Codecov from
guessing whether to wait for more uploads for the CI or start
processing them already.

Upstream refs:
* https://docs.codecov.com/docs/cli-options#send-notifications
* https://docs.codecov.com/docs/notifications#preventing-notifications-until-youre-ready-to-send-notifications
* https://docs.codecov.com/docs/codecovyml-reference#codecovnotifymanual_trigger
* https://github.com/codecov/codecov-cli/pull/195 (d634ebd8f2)
* https://github.com/codecov/codecov-action/issues/1436
* https://github.com/codecov/engineering-team/issues/107
* https://github.com/codecov/roadmap/issues/20
* https://github.com/codecov/feedback/discussions/204#discussioncomment-8796433
* https://github.com/codecov/engineering-team/issues/1245
* https://github.com/codecov/engineering-team/issues/3
* https://github.com/codecov/worker/pull/14 (71626b6368)
2 months ago
Martin Krizek 05d5b0f168
Avoid the ssh-agent exiting before tests end (#85979)
There were couple of occurrences where the hard 30 seconds limit on
running ssh-agent was not enough for the test to run and the ssh-agent
was killed resulting in the test failing with "Connection refused". This
change just lets the agent run in the background and kills it
manually after the tests finish.
2 months ago
sivel / Matt Martz 726e8d6548
Bump devel to 2.21 (#85992) 2 months ago
Michał Gąsior 9fcf1f7c58
Fix psrp - ReadTimeout exceptions now mark host as unreachable (#85974)
* psrp - ReadTimeout exceptions now mark host as unreachable

* add try to _exec_psrp_script

* fix indent E111

* update raise format

switch to raise Exception from e

Co-authored-by: Jordan Borean <jborean93@gmail.com>

---------

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2 months ago
sivel / Matt Martz c02f59ca3a
fix urls in additional ansible-doc test (#85988) 2 months ago
Matt Clay 83c79240ec
ansible-test - Update base/default/distro containers (#85985) 2 months ago
Matt Clay 7c2311d547
ansible-test - Upgrade coverage to 7.10.7 (#85981) 2 months ago
Matt Clay de7dd5bbb2
ansible-test - Update pinned pip to 25.2 (#85982) 2 months ago
sivel / Matt Martz 5a9afe4409
Fix signal propagation (#85907) 2 months ago
Matt Clay 9ee667030f
ansible-test - Update sanity test requirements (#85980) 2 months ago
Matt Clay 82b64d4b69
ansible-test - Update base/default containers (#85967) 2 months ago
Matt Clay 06456c68ec
Use bcrypt < 5 for unit tests (#85969) 2 months ago
Sviatoslav Sydorenko 53afc6f203 Mention pkg name in `package-data` sanity output
The logs were displaying a series of numbers in parens like `(66.1.0)`
at the end of each error line. its unintuitive what that means. I had
to look into the source code to confirm my suspicion of it being the
version of `setuptools`. This patch spells it out.
2 months ago
Sviatoslav Sydorenko 0cd36ce6d0 Use strict_optional @ ansible.galaxy.dependency_resolution
This patch drops unnecessary default for
`CollectionDependencyProvider`'s `concrete_artifacts_manager` argument
as it is always passed, in every place across the code base where the
provider is constructed.

It was also causing MyPy violations on calls to
`_ComputedReqKindsMixin.from_requirement_dict()` in the "strict
optional" mode which is now enforced for $sbj, while remaining
disabled globally.

It is a #85545 follow-up.
2 months ago
Sviatoslav Sydorenko c9131aa847 Type-annotate ansible.galaxy.dependency_resolution
This patch is a combination of `pyrefly autotype` and manual
post-processing. Parts of it migrate pre-existing comment-based
annotations, fixing incorrect ones where applicable.

The change also configures MyPy to run checks against actual
`resolvelib` annotations and includes a small tweak of
`ansible.galaxy.collection._resolve_depenency_map` to make it
compatible with those.

Co-Authored-By: Jordan Borean <jborean93@gmail.com>
Co-Authored-By: Matt Clay <matt@mystile.com>
Co-Authored-By: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 months ago
David Shrewsbury feda8fc564
Fix flakey get_url test (#85953) 2 months ago
sivel / Matt Martz 6673a14a9e
Update DataLoader.get_basedir to be an abspath (#85940) 2 months ago
s-hamann 0c7dcb65cf
fetch - return file in result when changed is true (#85729)
Set the (source) file attribute in the return value if the file changed
(e.g. on initial fetch). The attribute is already set in all other
cases.
2 months ago
Martin Krizek 686c3658ae
Deprecate `ansible.module_utils.six` (#85934)
* Deprecate `ansible.module_utils.six`

Fixes #85920
2 months ago
Sloane Hertel cb2ecda514
Remove support for resolvelib < 0.8.0 (#85936)
* Remove support for resolvelib < 0.8.0

Remove code handling differences between resolvelib 0.5.3 and 0.8.0

Drop some versions from the test to reduce the time it takes to run

Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>

* Remove type annotation

---------

Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
2 months ago
Martin Krizek 313c6f6b4d
Don't special case implicit meta tasks when filtering on tags (#85805)
* Don't special case implicit meta tasks when filtering on tags

Fixes #85475
2 months ago
Abhijeet Kasurde 6bee84318d
known_hosts: return rc and stderr in fail_json (#85871)
* When ssh-keygen fails, return rc and stderr in fail_json
  in order to help debugging.

Fixes: #85850

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2 months ago
Martin Krizek c3f87b31d1
import_tasks processing closer to include_tasks (#85877)
Fixes #69882
Closes #83853
Fixes #85855
Fixes #85856
2 months ago
Abhijeet Kasurde c5e6227bdb
falsy: Update doc (#85913)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2 months ago
Luca Steinke eafa139f77
fix description of truthy test (#85911)
There's a "not" too much here.

Maybe further examples can be found.
2 months ago
Felix Fontein c6d8d206af
Make sure ansible-doc doesn't crash when scanning collections whose path contains ansible_collections twice (#85361)
Ref: https://github.com/ansible/ansible/issues/84909#issuecomment-2767335761

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2 months ago
Matt Davis 5125ec797c
update 2.20 release codename (#85900) 2 months ago
Abhijeet Kasurde 5fc4b8c106
action: more debugging information (#85839)
* action: more debugging information

* Allow user to identify underlying problem with chmod, setfacl
  command.

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Review requests

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Review requests

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Review requests

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) 1e572ba5cc
🧪 Pin codecov-cli deptree used in AZP
PR #85888

`codecov-cli == 11.0.3` allows `click == 8.3.0` in its deps but the latter causes commit auto-discovery breakage in the former. With https://github.com/getsentry/prevent-cli/pull/95, `codecov-cli == 11.2.3` excludes this version so this patch updates the requirement to that.

To prevent this from happening again, the change also makes use of a pip constraint file that pins the entire dependency tree to concrete versions. The constraint file is managed by `pip-tools`.

Refs:
* https://github.com/getsentry/prevent-cli/pull/95
* https://github.com/pallets/click/issues/3066

ci_coverage
ci_complete
2 months ago
Matt Clay 58bad71859
Move display internals into _internal (#85889) 2 months ago
Chris Meyers 79ddee15a0
Prevent IO capture hang/loss in `basic.run_command` (#85869)
* Prevent run_command output truncation or hang

In cases when the selector used to monitor stdout/stderr activates without
data ready to read (a rare but normal condition), a read from a non-blocking
FD can return `None`, which was being conflated with an empty read (EOF)
condition. This caused the selector to be unregistered prematurely,
sometimes resulting in truncated output or hangs. `None` read results
are now excluded from EOF conditions.

* add changelog

---------

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
3 months ago
Sloane Hertel 27a56a34df
Add feature preview play argument spec validation (#85763)
* Add new play keyword validate_argspec

Set to True to use the play name as the argument spec identifier. A play name is required (i.e. a host pattern is not supported as an argument spec name).

Alternatively, set to a specific argument spec name.

A valid argument spec for the play is required. Example:

# playbook.meta.yml
argument_specs:
  name of the play:
    options: {}

* Play argument spec validation runs after fact gathering

Play keywords like tags are inherited and work similarly to fact gathering
3 months ago
Brian Coca c87dc6ed7d
script inventory plugin correct error message (#85765)
type was reflecting 'converted' type, not 'pre conversion' of the data
now message points at specific data keys
add deprecation tests
3 months ago
Sloane Hertel 43bb87107d
Remove 'usage' parameter from CLI.init_parser and ansible.cli.arguments.option_helpers.create_base_parser (#85859)
The usage is generated from CLI arguments
3 months ago
Sloane Hertel 5e8815b823
Fix ansible-doc -l/-F/--metadata-dump for relative imports in filter/test plugins (#85801)
* Add test for sidecar documentation for filter plugin in a subdirectory

Fix ansible-doc --list/--list_files/--metadata-dump for relative imports in nested filter/test plugin files
3 months ago
Sloane Hertel ced362a50d
ansible-galaxy - remove deprecated v2 API (#85830)
* ansible-galaxy - remove deprecated v2 API

Update unit tests exercising the v2 Galaxy API

Remove v2 API integration tests

* Remove internal test configuration for servers which support API v2 and v3

* Update and simplify verify tests by using the configured server list
3 months ago
Ben Buchwald e30da51731
Fix jsonfile cache on WSL (#85816)
On WSL, `os.rename` can't correctly move a file while a handle to that file is still open. It remains half-moved where neither the source or destination seem to exist (according to `os.path.exists`). However the move seems to complete correctly when the open handle is closed.

In `BaseFileCacheModule`, when writing a cache file, a temporary file is created with `mkstemp` that returns an open file descriptor and a filename. Once the cache is written to that file, it is renamed to the correct file name with `os.rename` and then its permissions set with `os.chmod`. On WSL the `os.chmod` fails because it doesn't think the file exists yet because the file descriptor returned by `mkstemp` is still open. This PR fixes this by closing that file descriptor before renaming.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
3 months ago
Matt Clay 967d654ef6
ansible-test - More container updates. (#85843) 3 months ago
Matt Clay 9966e01f81
ansible-test - Update containers (#85842) 3 months ago
Ketan Kelkar 18691ec83f
Replace module - update string comparison method from bytes to unicode (#85785) 3 months ago
Abhijeet Kasurde cf9d78206c
blockinfile: use line_separator variable (#85798)
* Future proofing the usage of line separator in blockinfile module.

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
3 months ago
Matt Clay d2940880ed
ansible-test - Upgrade coverage to 7.10.6 (#85831) 3 months ago
Zdeněk Vydra 60511c2a08
Fix uri form-multipart to not overwrite filename to allow retries (#85010) 3 months ago
Matt Clay ddbedc6ac6
Update mypy sanity test requirements (#85832) 3 months ago
Jordan Borean eda1383da7
Remove deprecation marker that has been actioned (#85812) 3 months ago
Jordan Borean 250610b924
Remove tarfile data_filter check (#85808)
Removes the now uneeded tarfile check for data_filter now that our
minimum Python version on the controller is 3.12 and guarantees it will
be present.
3 months ago
Jordan Borean aad9fbd4f5
Windows async - handle trailing junk output (#85820)
Add handling for when a PowerShell module emits more than just the
module result JSON. The behaviour reflects the Python async wrapper
where trailing data after the module result will emit a warning.
3 months ago
Matt Martz df1da0419e
Remove duplicate future import (#85824) 3 months ago
Abhijeet Kasurde 1cd4369815
fetch_file: add ca_path and cookies parameters (#85187)
* Added ca_path and cookies parameter arguments to fetch_file method
  to specify CA path and Cookies to fetch file from URL. These parameters
  are already supported by fetch_url.

Fixes: #85172

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
3 months ago
Martin Krizek 065f202d30
Remove (de)serialize methods (#85724)
* move task specific from_attrs to Task
* Keep deserialize on PC, add tests
3 months ago
Patrick Kingston 36f00cdf1a
Expand integration test coverage for `deb822_repository` module
PR #85586
3 months ago
Abhijeet Kasurde 975f60ebf9
encrypt: Remove deprecated passlib_or_crypt API (#85506)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
3 months ago
Abhijeet Kasurde a805356358
include_vars: Code cleanup and integration tests (#85292)
* Updated docs
* Removed stale code
* Added integration tests for better coverage

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
3 months ago
Matt Clay a25fd1021a
ansible-test - Fix traceback on missing tmp dir (#85814) 3 months ago
Jordan Borean f29d432c69
powershell - remove quoting logic (#85781)
Attempts to simplify the PowerShell code and special edge cases that
removes quotes from a value like a src or destination path on Windows
hosts. This should not be needed as paths should not be quoted when it
comes to this section of the code.

ci_complete
3 months ago
Jordan Borean a345a404e0
shell - deprecates the wrap_for_exec API (#85782)
Deprecates the function `wrap_for_exec` on shell plugins. This is to
simplify the API and remove unecessary components that should live
elsewhere or have a better and more flexible API.
3 months ago
Jordan Borean 3582997698
Remove deprecated vars plugin fallback (#85809)
* Remove deprecated vars plugin fallback

Removes the vars plugin `get_host_vars` and `get_group_vars` fallback
which was deprecated.

* Remove integration tests for removed feature
3 months ago
Jordan Borean 94c78cb38f
Removed deprecated DEFAULT_TRANSPORT smart option (#85810)
* Removed deprecated DEFAULT_TRANSPORT smart option

Removes the logic for handling `DEFAULT_TRANSPORT` set to `smart`.

* Remove unused import
3 months ago
Matt Martz c59db5349e
Add typing to to_text and to_bytes, improve typing and type juggling in DataLoader (#85746) 3 months ago
Felix Fontein 4209d714db
validate-modules and return fragments: fix bug in markup check, fix bug in missing doc fragment check, add tests (#85638)
* Prevent crashing on invalid structure.

* Also process return doc fragments.

* Fix handling of missing doc fragments.
3 months ago
Felix Fontein 4c27ccf8f4
default callback: allow to configure indentation (#85497)
* Comment on PyYAML's behavior if indentation is set to 1, or to 10+.
3 months ago
Abhijeet Kasurde d93f63ecfb
apt_repository: Use correct debug method (#85786)
* Use self.module.debug method instead of non-existent
  self.debug method

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
3 months ago
Sloane Hertel 0ed37ca899
setup - add logical volume facts scoped by volume group (#85705)
Add an 'lvs' key to each value in ansible_facts['vgs'] to support extracting all logical volume facts.

Add note to consider deprecating ansible_facts['lvs'] in a future release since it is misleading if any volume groups have identical logical volume names.

Fixes #85632
3 months ago
Abhijeet Kasurde 7b1644e0b3
dnf: Check if installroot is directory or not (#85748)
* dnf: Check if installroot is directory or not

* dnf library creates installroot if it is missing.
  check if installroot is directory or not.

Fixes: #85680

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
3 months ago
Abhijeet Kasurde a8dc3fae1e
cron: misc fixes (#85733)
* removed elif in when return is used
* removed redundant module.exit_json

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
3 months ago
Matt Clay be9e57366b
ansible-test - Update Ansible Core CI auth (#85717)
Implement new authentication methods for accessing the Ansible Core CI service.
3 months ago
Matt Clay e8a3be9de5
ansible-test - Update sanity test and coverage requirements (#85761)
* ansible-test - Update sanity test requirements

* ansible-test - Update coverage to 7.10.5
3 months ago
Martin Krizek 6976e13075
ternary: evaluate values lazily (#85752)
Fixes #85743
3 months ago
Martin Krizek b3ef4f7671
sanity: warn on ansible.module_utils.six imports (#85651)
Co-authored-by: Matt Clay <matt@mystile.com>
3 months ago
Martin Krizek 3ec07418aa
ansible-doc: remove displaying role attributes (#85725) 3 months ago
Trident101 14115afdb2
Remove excessive apostrophe (#85710)
Change:
The pkg_info‘ option was added in version 2.13.

To:
The pkg_info option was added in version 2.13.
3 months ago
Martin Krizek 5e78bc8eda
vault/unvault filters: remove deprecated vaultid parameter (#85744) 3 months ago
Matt Clay 7b598f3fc9
CI - Add missing args to generic.sh (#85737) 3 months ago
Brian Coca 534b8c225a
vars deprecation (#85673)
internal 'vars' dict cache has not been used for long time, but kept since we could not deprecate and some users had found it
3 months ago
Brian Coca 931c923e0e
Deprecate defaulting to inject (#85323)
INJECT_FACTS_AS_VARS config deprecate default of true
3 months ago
Brian Coca 75ad1f8d6a
tags warn wwhen using reserved tags (#85631) 3 months ago
Brian Coca 8b6446f2d5
Deprecate hash_params (#85630)
we stopped using it long ago, no plugin should be using it either, but JIC deprecate

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
3 months ago
Martin Krizek c5ddc93767
Expose ansible_failed_task in rescue for explicit flush_handlers (#85687)
Fixes #85682
4 months ago
Matt Davis b1fc98c8ad
Include result origin in broken conditional message instead of result (#85695)
Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Matt Davis 558676fcdc
Fix marker handling in templating (#85690)
* allow markers to pass through template lookup
* avoid tripping markers within Jinja generated code

Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Matt Davis 3518d48146
ensure undefined marker access on Jinja getattr->getitem fallback (#85688)
Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Matt Davis 0467e1eaa9
add known_issues for Jinja set/with (#85677) 4 months ago
Matt Davis 5345ac9911
eliminate None template nodes in _flatten_nodes (#85676)
* defers value or concat choice until Nones are gone
* fixes None -> empty string for TemplateModule cases
* add tests
4 months ago
Abhijeet Kasurde 603dd2d793
test: Remove redundant Python 3 condition (#85664)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Ketan Kelkar 18289c403d
Blockinfile - Add new module option - 'encoding' (#85291)
Signed-off-by: Ketan Kelkar <ktnklkr@gmail.com>
Signed-off-by: Yogesh Rana <Yogesh.Rana@ibm.com>
Co-authored-by: Yogesh Rana <Yogesh.Rana@ibm.com>
Co-authored-by: Yogesh Rana <36674300+yrana17@users.noreply.github.com>
Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Matt Davis e3c9908679
Backward-compatible None handling in template concat and argspec str (#85652)
* templating coerces None to empty string on multi-node result

* avoid simple cases of embedded `None` in multi-node string concatenated template results ala <=2.18
* single-node template results preserve NoneType

* add None->empty str equivalency to argspec validation

* fix integration tests
* remove conversion error message check from apt_repository test
* remove error message check on `None` value for required str argspec in roles_arg_spec test (now logically-equivalent to empty string)

* explanatory comment for None->empty str coalesce
4 months ago
Matt Clay 76748b8478
Fix filter plugin result processing (#85653) 4 months ago
Matt Clay 00fe38215c
Fix slicing of tuples in templating (#85608)
* Fix slicing of tuples in templating

* Improve lazy container test coverage
4 months ago
Ketan Kelkar 4cb5fe44b6
Lineinfile - Add new module option - 'encoding' (#84999)
Signed-off-by: Ketan Kelkar <ktnklkr@gmail.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Martz <matt@sivel.net>
4 months ago
Abhijeet Kasurde 90f62f3fdf
regex: validate input before processing (#85629)
* Validated user input for match_type before processing
* added new match_type 'fullmatch'

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Martin Krizek 0cc771dc3c
six cleanup (#85284)
Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Felix Fontein 45d62a726c
ansible-doc: show 'notes', 'seealso', and top-level 'version_added' for role entrypoints (#81796)
* Show 'notes', 'seealso', 'requirements', and top-level 'version_added' for role entrypoints.

Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Sloane Hertel 15e9f51e2d
Task.resolved_action - fix resolving static actions consistently for callback plugins (#85524)
* Resolve static actions when the FQCN is already known or demanded by a callback plugin

shorthand syntax (e.g. "- ping:") is resolved by ModuleArgsParser

action/local_action syntax (e.g. "- action: ping") is resolved on demand

* Emit a warning if a callback plugin accesses the property when it's None. This is expected if action/local_action is a template and a callback plugin uses this value too early (like in v2_playbook_on_task_start) or late (like in v2_runner_on_ok for a task with a loop).
4 months ago
Sloane Hertel 9a6420e1d5
Fix nested import_tasks when the parent import contains a template (#85599)
* Test nested import_tasks when the parent import contains a template

* Fix templating the parent_include.args
4 months ago
Martin Krizek 4c04b8c7c3
IncludedFile: store _from args for proper deduplication (#85628)
* IncludedFile: store _from args for proper deduplication

Fixes #66497

Co-authored-by: Matt Martz <matt@sivel.net>
4 months ago
Abhijeet Kasurde 9ed7164ed6
service_facts: Handle KeyError while processing service name (#85572)
* service_facts: Handle KeyError while processing service name

As a part of follow up review,

* Handle KeyError with exception handling
* Warn user about the missing service name in the given service details

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Matt Davis faf86ca2b3
Add temporary module result serialization hook (#85609)
* Add temporary module result serialization hook

* Sanity test fix

---------

Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Brian Coca ca5871f256
add fragments to return (#72635)
* ansible-doc add ability to use doc_fragments for RETURN


---------

Co-authored-by: Felix Fontein <felix@fontein.de>
4 months ago
Sloane Hertel 945516c209
ansible-galaxy - remove internal path when using AnsibleCollectionConfig.collection_paths (#85596)
* remove internal collections earlier to ignore consistently for different sub-commands

* remove internal collection handling from the dependency resolver

* add a test to ensure ansible._protomatter is not in the output of ansible-galaxy collection list

* fix existing test to ensure an error is given if no valid collection path is configured

* changelog
4 months ago
Abhijeet Kasurde 97b2242b78
wrapt: Bump version from 1.15.0 to 1.17.2 (#85500)
Fixes: #85407

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Patrick Kingston 817f0af239
pip - fix reporting changed for empty venv creation (#85556)
* Add correct empty venv creation handling

Makes the module exit with changed=True
when an empty venv is created with correct
module output

* Add tests for creating an empty venv
4 months ago
Martin Krizek c0256d6edf
dnf/dnf5: address issues discovered in 2.16 yum tests (#83659)
Fixes #85554
4 months ago
Matt Clay dc5209a3fd
ansible-test - Replace TypeVar usage (#85603) 4 months ago
Matt Clay 5083eaffc6
Eliminate more TypeVar and ParamSpec usage (#85602) 4 months ago
Matt Clay f2612fbe3a
Drop Python 3.11 controller support (#85590) 4 months ago
Matt Clay 8aad1418f6
Ignore failing unarchive test on FreeBSD (#85601) 4 months ago
Brian Coca 29a298a617
test fix to avoid permissions issue (#85598) 4 months ago
Matt Martz f51e626c32
Move the shell target to group4 controller (#85594)
* Move the shell target to group4 controller

* rename shell target to shell-plugins
4 months ago
Brian Coca 5faa256178
ansible-galaxy, dont display internals (#85571)
Also note broken test for invalid collection paths

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
4 months ago
Maxime 340ca1b493
Fix code typo in docstring of DataLoader (#85570) 4 months ago
Martin Krizek fcb829f724
Fix incorrect return value type of _copy_included_file (#85472) 4 months ago
Martin Krizek ac5eb232e9
Do not re-add tags on blocks from within import_tasks (#85471) 4 months ago
Abhijeet Kasurde e62cfa2c02
test: correct variable in debug (#85529)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Matt Clay 62dc40ce1c
Update azure-pipelines-test-container (#85578) 4 months ago
Matt Clay 5fbce46dcf
ansible-test - Update pinned sanity test requirements (#85577) 4 months ago
Matt Clay 6b2b665ef7
Add support for Python 3.14 and drop Python 3.8 (#85576) 4 months ago
Matt Clay 647e7409eb
Avoid mocker fixture in copy unit tests (#85575)
The mocker fixture does not clean up mocks early enough, which can cause problems for pytest infrastructure.
4 months ago
Matt Clay 43a20c9f68
Fix paramiko deprecation unit test (#85573)
The unit test previously assumed paramiko was installed, and would fail if it was not.
4 months ago
Matt Clay 9b266da14f
ansible-test - Update containers and remotes (#85562) 4 months ago
Matt Clay 58c9f48029
ansible-test - Replace FreeBSD 14.2 with 14.3 (#85561)
* ansible-test - Replace FreeBSD 14.2 with 14.3

* Fix CA bundle search priority
4 months ago
Matt Clay 2e71e5aeb9
ansible-test - Replace RHEL 9.5 with 9.6 (#85558) 4 months ago
Matt Clay 35830cb054
ansible-test - Fix coverage config (#85555) 4 months ago
Abhijeet Kasurde ea238c9eb5
tqm: Use correct warning methods (#85434)
* Use display.error_as_warning instead of self.warning
* Use display.error_as_warning instead of display.warning_as_error.

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Matt Clay ee297bb7ca
ansible-test - Limit bootstrap package install retries (#85544) 4 months ago
Matt Clay 853752a3eb
ansible-test - Upgrade to coverage 7.10.0 (#85541) 4 months ago
Abhijeet Kasurde 181dbdbf27
filter: update integration tests (#84990)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Matt Clay cdb7af094b
ansible-test - Use OS packages on FreeBSD 13.5 (#85530) 4 months ago
Brian Coca 19f9c66004
plugin config options are now correctly fetched with origin (#85488)
* also update callbcacks, since they override these functions
due to backwards compat _options being taken for CLI
4 months ago
Aditya Putta a0d56d2f4f
Usage of 'sleep' parameter in ansible.builtin.wait_for_connection (#85435)
Signed-off-by: Aditya Putta <puttaa@yahoo.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Matt Davis 2fbd7c114e
Rewrite exception key on failed_when: false (#85516)
* Prevents callback handle_exception from displaying the captured exception when the task is not failed.
* Added tests.

Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Patrick Kingston 737c68ace3
Add install_python_debian parameter to deb822_repository (#85487)
* Add python3-debian dependency installation in module

* Add tests to exercise automatic dependency installation

* Fix broken tests to include new module parameter

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Abhijeet Kasurde d2be8684b3
Remove deprecated py3compat.environ call (#85501)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Abhijeet Kasurde a2427e45df
docs: use correct URL in docs (#85491)
* wait_for: use correct URL in docs

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Abhijeet Kasurde 19c7ec6ed2
Distribution: Added UCS in Debian OS Family (#85496)
* Identify Univention Corporate Server as Debian OS Family.

Fixes: #85490

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Brian Coca 8c3d23513f
removed removed acceleration keywords (#85507) 5 months ago
Jordan Borean 3882366585
Add AnsiballZ debugging support with debugpy (#85476)
* Add AnsiballZ debugging support with debugpy

Adds support for debugging AnsiballZ modules with debugpy which is used
by VSCode as its Python debugger DAP. Debugging can either be done
through a manual Debugpy listening server through a launch.json
configuration or through the new ansible-test --dev-debug-on-deman
argument.

* Fix up integration test

* Simplify config option and move mypy ignore

* Use new API if available and fix typo

* Guard the import of debugpy

* Fix sanity import issue

* Minor cosmetic adjustments

* Simplify debugger setup

* ansible-test - Refactor debugging interface

* Add ansible-test debug integration tests

* Fix ansible-test shell when in unsupported dir

---------

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Abhijeet Kasurde eb5e57a8f0
six: bump version from 1.16 to 1.17 (#85478)
Fixes: #85408

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
5 months ago
Matt Martz ee96f8e912
Use the API task URI directly for polling collection imports (#85419) 5 months ago
Brian Coca 319dca2ea8
meta: clear_host_errors, clarify what this applies to (#85463)
* meta: clear_host_errors, clarify what this applies to

It clears host for selection, but does not change state in the current iterator.

* also update example
5 months ago
Sloane Hertel da6735160d
Fix passing callbacks the delegated connection, host, port, and user (#85397)
Fix ssh plugin host variables. Variable names should conform to Python variable naming rules.
, and not contain characters like "[" or "]".

Update unit test
5 months ago
Martin Krizek c24b187f88
dnf/dnf5: remove deprecated install_repoquery option (#85440)
https://github.com/ansible/ansible/issues/85410
5 months ago
Martin Krizek e4135b6f19
yum_repository: remove deprecated keepcache option (#85441) 5 months ago
Abhijeet Kasurde 8207406306
Fixed string type in tags fieldattribute (#84655)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 months ago
Abhijeet Kasurde 34f2f39abe
json filter: update docs (#84989)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Clay d19366331f
ansible-test - Remove obsolete network provisioning (#85433) 5 months ago
Matt Clay 35252fd96c
Drop incidental network tests from CI (#85425) 5 months ago
Matt Davis 6b347bfbf7
default _ansible_tracebacks_for to [] when not specified (#85427)
* eases module unit tests that aren't using our fixture
5 months ago
Patrick Kingston a032f96222
Expand expect module test suite (#85422)
* Test expect module for missing pexpect

* Test expect module for incorrect timeout type

* Test expect module for out of date pexpect failures

* Test pexpect.ExceptionPexpect

Also fixed task naming to be inline with the rest of the file.

* Change pexpect management to venv

* Normalize b_out to b'' when falsy for consistent handling

* Move test venv from /tmp/ to output_dir

* Update tests according to corrections

* Remove break_system_packages when installing pexpect 3.3

* Remove unnecessary if statement

pexpect.run(...) shouldn't ever return None, so it's safe
to remove the check entirely. Maintains 100% coverage
5 months ago
Abhijeet Kasurde e162eda1e6
apt: Mark dependencies as auto (#85170)
* Mark dependent packages as auto which are installed as part of
  deb file installation

Fixes: #78123

Co-authored-by: Matt Clay <matt@mystile.com>
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
5 months ago
Thomas Sjögren 205ca648bf
ansible-doc: print where the description is missing (#85320)
* ansible-doc: print where the description is missing

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
5 months ago
Abhijeet Kasurde 557733abb1
yaml filter: update docs (#85261)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
5 months ago
Xiao Wenyang a4e3575077
stat module, add option to return SELinux Context
Added get_selinux_context option
5 months ago
Matt Clay a1d25cca00
ansible-test - Upgrade coverage to 7.9.1 (#85411) 5 months ago
Matt Clay 6ff6339191
Ensure config env/ini values are tagged (#85404)
* Ensure config env/ini values are tagged

Config env and ini values now have origin and trust tags applied.

* Remove unused import
5 months ago
Matt Davis d6efb7db8a
Short-circuit legacy network module prefix->action mapping (#85406)
* Short-circuit legacy network module prefix->action mapping

* Modified a non-short-circuit compound conditional in a legacy networking path that attempted to resolve an action for any module name containing `_`. The bug was always present, but the typical presentation (an ImportError) was ignored prior to 2.19.
* The legacy networking path should be deprecated and removed in 2.20- a module could still be run under the wrong action if one with a matching prefix is found.

* unit test fix
5 months ago
Matt Clay ac8c66d431
Bump devel version to 2.20.0.dev0 (#85409) 5 months ago
Matt Clay 3511299e1e
Fix deprecated pylint plugin version parsing (#85402) 5 months ago
Sloane Hertel 7216e04139
Remove deprecation warning caused by automatic role argument spec validation (#85401) 5 months ago
Martin Krizek 54ccad9e46
Limit askpass prompts to single attempt (#85364)
* Limit askpass prompts to single attempt

OpenSSH client option NumberOfPasswordPrompts defaults to 3 so in case
an incorrect connection password is provided it is excessively tried 3
times. Not only that but running the `_ssh_askpass` entry point multiple
times (via ssh) results in `json.decoder.JSONDecodeError` as after the
first run the shared memory is zero'd and the subsequent runs end up
calling `json.loads` on empty data.

`json.decoder.JSONDecodeError` does not happen prior to Python 3.13 as
the share memory is unlinked automatically on `.close()` and the
`_ssh_askpass` entry point exits with return code 1 before attempting to
load zero'd memory.

Fixes #85359

* changelog and tests

* Update changelogs/fragments/85359-askpass-incorrect-password-retries.yml

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

* Update lib/ansible/cli/_ssh_askpass.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

* Avoid race condition in second unlink

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Patrick Kingston fcffd707c6
Test multiple inheritance in _utils get_all_subclasses (#85396)
Should bring code coverage in _utils.py to 100%.
Ensures get_all_subclasses won't enter infinite recursion.
5 months ago
Matt Davis 73369f53af
Remove redundant vars FA on PlaybookInclude (#85395)
* The redundant FA declaration was not static, which broke a number of automatic validation behaviors.
* Added tests to assert deferred validation and lack of templating on `import_playbook.vars`.

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis 29cdba1fee
unified Marker propagation for all Jinja plugin/call ops (#85391)
* Errors raised in most Jinja operations and plugin invocations are now propagated as Markers, allowing template pipeline to continue execution when a Marker-aware consumer is present.
* Added ability to inspect ExceptionMarkers to Protomatter `dump_object` filter.
* Added tests.

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis 649c9ec443
Encryptedstring redact fixes (#85390)
* misc DTFIX/docstring cleanup

* fix EncryptedString redaction, add tests

Co-authored-by: Matt Clay <matt@mystile.com>

* Fix test failures

---------

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis db819d2514
ensure transform_to_native_types converts keys (#85389)
* added basic key visitor support to variable visitor (off by default)
* transform_to_native_types enables new key visit/conversion
* add test

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Clay 4a03ccbd41
Use codecov-cli for uploads (#85386)
ci_coverage
ci_complete
5 months ago
liviozanol 66a7cfe77d
Docs: fix small typo (#85388) 5 months ago
Matt Davis 11f5563895
Jinja sandbox refinement (#85385)
* DTFIX recategorize

* fix ansible-console generated task dict

* use non-deprecated task shape

* switch Jinja from ImmutableSandboxedEnvironment to SandboxedEnvironment

* Restore ability to call collection mutation methods.
* Restore ability to directly call integer bitwise operator methods.
* Adjust tests.

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Patrick Kingston e7c7df7074
Add test coverage to ansiballz builder source mapping (#85382)
Should bring code coverage in _builder.py to 100%.
5 months ago
Matt Davis 547c64f326
deprecate esoteric/undocumented playbook syntaxes (#85378)
Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis 1f8937b57e
restore playbook import DS rewrite (#85379)
* add tests for FQ "action" aliases
* add validation for multiple directives

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis 3c52b14c9e
deprecate invalid variable names in inventory (#85377)
* deprecate invalid variable names in inventory

* was previously a hard error for `Host`
* added missing check to `Group`
* swapped blanket Python keyword prohibition with Jinja singleton and `not` check

Co-authored-by: Matt Clay <matt@mystile.com>

* fix invalid variable name test

---------

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Nils Brinkmann 578d25f286
Add type annotations to the `Role.__init__()` method
PR #85346

This patch adds type-checking to the `Role.__init__()` method. 

Context: https://github.com/ansible/ansible/pull/85249#issuecomment-2956115486

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-authored-by: Nils Brinkmann <nils.brinkmann@rheinmetall.com>
5 months ago
Martin Krizek ef9d92b31d
Test both original and latest dnf versions (#85342)
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Davis dde10a9afb
import_playbook validation cleanup (#85358)
* use declarative FA validation
* deleted redundant/broken imperative validation
* added test case to ensure templating

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Clay 3354d0d4e2
Add ticket stub for minor changes (#85350) 6 months ago
Matt Davis fa9f286096
display wrap/format arg cleanup (#85352)
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Martin Krizek 34abc83822
Remove Python 2 mentions (#85353) 6 months ago
Matt Davis 46abcfcc82
feature-flag experimental module metadata (#85351)
* added ansible-test integration env/set directive for aliases
* applied to module-serialization-profiles test to enable feature flag

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Sloane Hertel 8e9f5fb9d5
password lookup - re-attempt acquiring lock file regardless of locale (#85318)
* Fix handling FileExistsError, instead of only handling OSError when the human-readable error message is "File exists".

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Clay d922398c4d
Show context for reserved variable warnings (#85324)
* Show context for reserved variable warnings

* Update integration test

* Use var origin not value origin

* Use a list

* Ensure tagged varname is used
6 months ago
leopardracer 678c6abc98
Update test-pause (#85347) 6 months ago
Matt Clay 83fcaeaa8b
Spelling fixes (#85345)
A few grammar fixes too.
6 months ago
Matt Davis eec57ec396
Misc callback fixes/cleanup (#85344)
* Misc callback fixes/cleanup

* Fix v1 callback method dispatch, fully deprecate v1 methods, add missing tests.
* Clean up callback plugin init/setup code, remove redundancies, improve error messaging.
* Remove unused callback method definitions from base class.

Co-authored-by: Matt Clay <matt@mystile.com>

* switch callback bypass to instance-level from class-level

* preserves any instance-level method magic that implementations were using

* add missing handler dispatch entry

* add tests to ensure all methods are covered

---------

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Maxim Evtush 778fdcbef1
Fix Typo in Variable Name and Update Test Data for Identifier Validation (#85338) 6 months ago
FT f6be5ab224
Fix Typos in Comments and Task Names (#85330)
* Update windows.yml

* Update test_manifest.yml
6 months ago
Matt Clay 093ac8df2d
ansible-test - Fix relative import resolution (#85328) 6 months ago
Matt Clay 025e9cfae6
Add type annotations to set_module_args (#85329) 6 months ago
Matt Davis ed90a424a9
fix script failed_when bypass (#85326)
* fix script failed_when bypass

* misuse of AnsibleActionFail for a retryable/alterable error case
* add tests

Co-authored-by: Matt Clay <matt@mystile.com>

* type annotation fixes

---------

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
fuder.eth f7e0612a85
Fix Typos in Integration Test Comments and Documentation (#85322)
* Update specific-revision.yml

* Update main.yml
6 months ago
Matt Clay 2991883672
ansible-test - Fix ansible-test debug from remote shell (#85321) 6 months ago
Abhijeet Kasurde cace19f365
apt: Consider timeout while invoking apt-get command (#85219)
* apt: Consider timeout while invoking apt-get command

* Apply timeout specified by user to apt-get command
  using '-o DPkg::Lock::Timeout=' syntax

Fixes: #78658

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
6 months ago
Matt Clay 7ef13cb29e
ansible-test - Add remote debugging support (#85317) 6 months ago
Brian Coca 137036e96f
wait_for module - document self match avoidance (#85251)
When using static string to search system log, avoid matching self execution
logged by Ansible by default.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Brian Coca 02c21742a3
Assemble add check mode (#85094)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
kilavvy a09b25a356
Minor Documentation and Comment Corrections (#85313)
* Update New-AnsiblePowerShellSignature.ps1

* Update ultimatequestion.yml
6 months ago
Brian Coca 8ec403a3b9
ansible-doc don't show empty paths (#85294)
If no path is given, it can only mean that it is a Jinja plugin, display Jinja as 'provider' then.
6 months ago
Matt Clay 4b0a5c5c63
ansible-test - Relocate internal CLI args (#85308)
This improves consistency by locating them with other global options.
6 months ago
Matt Clay 76ad0b636f
ansible-test - Move metadata to environment (#85307) 6 months ago
Brian Coca 7e495f4b20
ansible-doc display docs for modules w/o ext (#85299)
Fixed case in which listing modules for docs failed to get sidecar

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
leopardracer 56de597fc7
Fix typos in documentation and test ignore list (#85303)
* Update ignore.txt

* Update invalid_choice_value.py
6 months ago
Matt Clay c8324aa01a
Fix bool filter for non-hashable types (#85300) 6 months ago
Sloane Hertel d3977ebc88
fix handler include_tasks templating (#85015)
* Add test for a handler including tasks from a variable filename

* Add FieldAttributeBase attribute to indicate if the object should be post validated

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
6 months ago
Martin Krizek 2cfb158536
module_utils/basic.py: properly deprecate importing `text_type` (#85293) 6 months ago
Matt Clay bdc6c8e16a
ansible-test - Code cleanup (#85297) 6 months ago
Matt Davis 1d1bbe3424
Fix post-fork deadlock from early Python writers like pydevd (#85296) 6 months ago
Matt Clay 714f796384
Fix nested include with templating (#85295) 6 months ago
Matt Clay 45dd2c0647
AnsiballZ refactoring and remote debug support (#85289) 6 months ago
David Shrewsbury aa8d58a174
get_url - check for incomplete data read (#85164) 6 months ago
Martin Krizek 532edf4c35
Fix templating tags on plays and roles (#82314)
Fixes #69903

ci_complete
6 months ago
Matt Clay 4956619ac2
Fix deprecation versions in template lookup (#85288) 6 months ago
Matt Davis 2bed98bd20
fix Marker handling on Jinja macro invocations (#85280)
* always allow Marker args to pass through
* always disable pre-emptive trip-on-retrieval for Macro JinjaCallContext
* add macro-callable template expression result test cases

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Martin Krizek 600c1e67b4
Exceptions clean up (#85176)
* replace usage of `IOError` as it is an alias to `OSError`
* replace usage of `socket.error` as it is an alias to `OSError`
* use subclasses of `OSError` rather than inspecting `errno`s
* utilize `exist_ok` parameter of `os.makedirs` rather than ignoring
  `FileExistsError`

Make the following changes to the exception handling this patch already
updates to be consistent with the new code:
* use `ex` as a name for exception being handled
* use `from ex` when re-raising exception for additional context
* use f-strings and `!r` for quoting
* pass exceptions to the `exception` parameter of `fail_json`
* use `display.error_as_warning` rather than passing stringified
  exception into `display.warning`

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Davis 43c0132caa
adjust PluginInfo to use PluginType enum (#85277)
* normalization fixups

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Davis 9f0a8075e3
Prevent template lookup and action from masking `ansible_managed` value (#85075)
* deprecate DEFAULT_MANAGED_STR and prevent masking of ansible_managed var

* adjust public API behavior

* restore backward-compatible behavior on existing public API
6 months ago
Matt Davis 2b7204527b
Restore 2.18 vault tag YAML dump behavior (#85275)
* Doing conditional redaction/formatting needs other bits that aren't ready for 2.19.

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Martin Krizek ea7ad90c31
Fix calls to `deprecated()` to include `help_text` arg (#85262)
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Clay 051f7e5944
Add missing docs for sftp_batch_mode (#85270) 6 months ago
Matt Clay 1c06c46cc1
Fix YAML loading/dumping and filters (#85266)
- from_yaml/from_yaml_all filters now preserve trust
- YAML dumping can once again handle undecryptable vaulted values
- increased test coverage

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
6 months ago
Matt Davis 6198c7377f
Fix incorrect behavior when a Jinja test returns Marker (#85264)
* Avoid Marker trip in plugin wrapper that causes unnecessary early template bailout.
* Remove spurious non-boolean result deprecation warning.
* Add test.

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Clay 7da24ca7b0
Fix logic error in ansible-galaxy (#85258)
Co-authored-by: OpenRefactory, Inc <56681071+openrefactory@users.noreply.github.com>
Co-authored-by: Munawar <munawar.hafiz@gmail.com>
6 months ago
Aditya Putta 0bbd8847c4
Use a Specific Package Manager (#82050)
* Use a Specific Package Manager

* Update the name of package manager from yum to dnf

* Update lib/ansible/modules/package.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

* Update lib/ansible/modules/package.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

---------

Co-authored-by: Aditya Putta <puttaa@skiff.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Davis bbbfbd57e2
fix key conversion on legacy JSON profiles (#85253)
* fix key conversion on legacy JSON profiles

* restore stdlib silent str conversion behavior for int/float/bool/None dict key types
* remove most conversions for non-scalar keys
* add key conversion cases to JSON profile test suite

* typo

* Fix sanity test failures

* Fix _handle_key_str_fallback implementation

---------

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Martin Krizek d7c4d0119f
Deprecate ShellModule.checksum() (#85216)
The methods have not been used, updated or tested since
b9d0662faf.
6 months ago
Matt Davis df0b417f2d
Resolve misc DTFIX0/1 (#85247)
* complete DTFIX0 after eval

* sunder-prefix Marker.concrete_subclasses

* re-home Jinja plugin decorators public API

* low-hanging/already fixed DTFIX cases

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Jordan Borean 8f2622c39f
doc - Dynamically document jinja builtins (#85215)
* doc - Dynamically document jinja builtins

This change has `ansible-doc` dynamically generate the documentation for
any Jinja builtin filter and test plugins. These dynamic stubs will
point to the official Jinja documentation pages for more information.

* Fix sanity issues

* Add tests

* Update Jinja builtin doc gen

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Martin Krizek 01bb9393d7
Merge dnf and dnf5 integration tests (#85199) 6 months ago
Martin Krizek 3505572470
Deprecate ansible.compat.importlib_resources (#85226)
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Martin Krizek 487d699226
Deprecate module_utils.common.collections.count (#85233)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Jordan Borean b4741fc495
Exclude ansible._protomatter from ansible-doc output by default (#85115)
* Exclude ansible._protomatter from ansible-doc output by default

* Added changelog
6 months ago
Matt Davis 0ee1c36779
local connection always passes str to Popen (#85239) 6 months ago
Matt Davis 2a24633964
Misc ssh agent fixes (#85238)
* Misc ssh-agent fixes

* Replace manual SIGALRM handling with new alarm_timeout context manager
* Misc error handling fixes to ssh-agent startup
* Add SSH_AGENT_EXECUTABLE config to ease failure mode testing
* 100% test coverage on agent startup failure code

Co-authored-by: Matt Clay <matt@mystile.com>

* make SSH Agent support internal

---------

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Clay eafe5fc739
Add missing warning methods and args (#85225) 6 months ago
Matt Davis cbcefc53a3
Clean up TE error handling, wrap sigalrm handler (#85232)
* Clean up TE error handling, wrap sigalrm handler

* Preserve error detail on AnsibleAction and Connection exceptions.
* Remove multiple layers of unreachable or redundant error handling.
* Wrap manual alarm signal/timeout handling into a context manager, add tests.

Co-authored-by: Matt Clay <matt@mystile.com>

* update error message check in test

* update test timeout message assertions

---------

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Brian Coca d41a3430b7
async handling changed to use 'true' booleans(#85074)
async_status and async_wrrapper now use booleans instead of 0/1 for 'thruthyness'
gather_facts also updated

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Martin Krizek 0e2f770a24
jinja2.__version__ is deprecated (#85221)
Prepare for its removal in Jinja 3.3.

See https://github.com/pallets/jinja/pull/2098
6 months ago
Matt Davis 91453e30af
Added _TEMPLAR_SANDBOX_MODE config (#85222)
* Added _TEMPLAR_SANDBOX_MODE config

* allows unsafe attribute checks to be disabled in Jinja sandbox

* Update lib/ansible/_internal/_templating/_jinja_bits.py

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Clay e2a5377b9a
ansible-test - Fix incorrect use of InferenceContext (#85230) 6 months ago
Matt Davis b71d9aa4a5
Decouple SSH client verbosity from Ansible display (#85224)
* decouple SSH client verbosity from Ansible display

* remove failing false-coverage unit test
6 months ago
Matt Davis 356bf336bd
fix from_yaml_all filter inconsistent None handling (#85223)
* fix from_yaml_all filter inconsistent None handling

* always returns empty list for None or empty string input

* deprecate non-string inputs for from_yaml and from_yaml_all
6 months ago
Harshvardhan Sharma f05b1d1ccf
Improve SUSE distribution detection using VARIANT_ID with fallback (#85152)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Martin Krizek 99a3346de6
dnf5 - handle all specific libdnf5 exceptions (#85175)
Fixes #84634
6 months ago
Martin Krizek a0132fec0b
dnf5 tests: do not remove attr (#85218)
On RHEL 10, the attr package is in the dependency tree of dnf itself
and cannot be removed.
6 months ago
Kimmo Suominen 3b66150cc3
Recognize virtualization type correctly on Linode (#85184) 6 months ago
Abhijeet Kasurde 068157618c
service: Remove py2 specific code (#85191)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
6 months ago
Martin Krizek f635a22d81
apt_repository: remove Python 2 support (#85212) 6 months ago
Jordan Borean 17cee7a982
win coverage - Fix untrusted coverage collection (#85197)
Fixes the logic when running a module through App Control when the
module is not trusted to run in Full Language Mode. This ensures
coverage will still run as expected and that the trust verification only
happens in the wrappers that actually run/prepare the code.

Also expands on a comment to clarify why only that branch is set to set
the internal file encoding to UTF-8.
7 months ago
Matt Clay 359173c006
Include message in captured tracebacks (#85196)
This matches the formatting of tracebacks from exceptions.
7 months ago
Matt Clay e226294855
display - Replace CRNL with NL (#85194) 7 months ago
Matt Clay 53b0f1645b
ansible-test - Add RHEL 10.0 remote (#85189)
* ansible-test - Add RHEL 10.0 remote

* Update tests for RHEL 10
* Fix iptables test
* Rework rpm_key integration test
7 months ago
Martin Krizek c6a2e5ea75
csvfile lookup: remove Python 2 compat (#85186) 7 months ago
Matt Clay 6a1c24ca99
Limit SSH agent DSA testing to RHEL 9 (#85193) 7 months ago
Jordan Borean 75f7b2267d
Add support for Windows App Control/WDAC (#84898)
* Add support for Windows App Control/WDAC

Adds preview support for Windows App Control, formerly known as WDAC.
This is a tech preview feature and is designed to test out improvements
needed in future versions of Ansible.

* Use psd1 and parse it through the Ast to avoid any unexpected execution results

* Add tests for various manifest permutations

* Ignore test shebang failure

* Apply suggestions from code review

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

* Use more flexible test expectations

* Add type annotations for shell functions

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
7 months ago
Matt Clay e82be177cd
ansible-test - Improve deprecated checking type inference (#85159)
* ansible-test - Improve deprecated checking type inference

Also disabled the ``bad-super-call`` pylint rule due to false positives.

* Add type comment support

* Try without using register_transform
7 months ago
Matt Clay feda0a5c6e
ansible-test - Fix option filtering (#85182) 7 months ago
Matt Clay 1e64707592
Remove unnecessary module shebang (#85183) 7 months ago
Matt Clay 242bb9ebab
DTFIX recategorization and error/warning refactor (#85181)
Co-authored-by: Matt Davis <nitzmahone@redhat.com>
7 months ago
Martin Krizek 40c919d7bd
Integration tests clean up (#85130)
* Integration tests clean up

* more

* we only test with Ubuntu 24.04 on the controller
7 months ago
Matt Clay 97dd5f104c
Expand scope of `black` sanity test (#85169) 7 months ago
Matt Clay 14bf64ddf8
Code formatting for .azure-pipelines/ (#85166) 7 months ago
Lee Garrett ebd022ee42
Mark integration tests as needs/root (#84487)
For calling setup_test_user, which adds a user to the system (and thus requiring
root):
- become
- become_su
- become_sudo
- slurp

And also:
- apt, which installs/removes system packages
- deb822_repository, which adds/removes apt repos
- hardware_facts calls losetup, which requires root
- package_facts, which installs/removes system packages

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
7 months ago
Matt Clay 930ffd1a83
Code formatting for packaging/cli-doc/ (#85167) 7 months ago
Matt Clay ed0e78fd9c
Code formatting for packaging/release.py (#85168) 7 months ago
Matt Clay 460343510c
Code formatting for test/sanity/code-smell/ (#85165) 7 months ago
Jordan Borean fe2d9e316a
Fix constructable inventory default keyed group (#85002)
Fix the logic for a constructable inventory `keyed_groups` entry to use
the `default_value` if the ``key` expression result is `None` or `omit`
and not just an empty string. This bug was introduced with the changes
in data tagging and goes back to the original behaviour.

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
7 months ago
Matt Clay 7ac74ab591
ansible-test - Update default containers (#85161) 7 months ago
Matt Clay 588410fe50
ansible-test - Update sanity requirements (#85160) 7 months ago
Matt Davis f5a85493c1
recategorize pass over DTFIX-MERGE entries post b4 (#85155) 7 months ago
Matt Clay 567fda6906
Add missing cache plugin test scenarios (#85154) 7 months ago
Matt Davis e5476972da
ensure builtin tests always return bool (#85149)
* added unit test validation and coverage enforcement

Co-authored-by: Matt Clay <matt@mystile.com>
7 months ago
Matt Davis 7be1359841
misc changelog and docstring cleanup (#85148)
* deferred listify_lookup_plugin_terms deprecation

Co-authored-by: Matt Clay <matt@mystile.com>
7 months ago
Matt Clay 93aa611435
release.py - Remove email announcement support (#85060)
Also add missing git and run overloads.
7 months ago
Matt Davis 9a426fe303
fix ensure_type to support vaulted values (#85129)
* restored parity with 2.18

Co-authored-by: Matt Clay <matt@mystile.com>
7 months ago
Matt Davis fc8a227647
ensure that all config return values are Origin-tagged (#85127)
Co-authored-by: Matt Clay <matt@mystile.com>
7 months ago
Matt Davis 9efba4f972
apply trust to declarative plugin config (#85126)
* trust strings in loaded doc fragments
* added tests
* added hard_fail_context test mechanism

Co-authored-by: Matt Clay <matt@mystile.com>
7 months ago
Lorenzo Tanganelli 8a4fb78988
facts: CloudStack KVM Hypervisor to Linux virtual fact (#85117)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago
Matt Clay 7b69cf3266
ansible-test - Relax some deprecation checks (#85122) 7 months ago
Matt Clay 4fe9606530
template module - render `None` as empty string (#85121)
* template module - render `None` as empty string

* Update changelogs/fragments/template-none.yml

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

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
7 months ago
Matt Davis d33bedc48f
Misc config type coercion fixes (#85119)
* remove dead config comment noise

* update `list` typed config defaults to be lists

* fix tag preservation/propagation in config
* numerous other ensure_type bugfixes
* 100% unit test coverage of ensure_type
* emit warnings on template_default failures
* fix unhandled exception in convert_bool on unhashable inputs

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Co-authored-by: Matt Clay <matt@mystile.com>
7 months ago
j-dr3 dcc5dac184
sysvinit: make examples consistent (#85108) 7 months ago
omahs 471c5229a7
Fix typos (#85107) 7 months ago
Martin Krizek 8b9ddf5544
Passing warnings to exit/fail_json is deprecated. (#85109) 7 months ago
Matt Davis 7e00053a30
add fuzzy matching to package_data sanity (#85103)
* add fuzzy matching to package_data sanity

* relaxes exact directory matches for license files to allow setuptools > 72 to pass

* sanity
7 months ago
Martin Krizek 107842fd7d
dnf5: skip pkgs that don't satisfy bugfix/security when specified (#85111) 7 months ago
pollenJP(@'ω'@) 1c29910087
get_url: missing closing brace in docs (#85096) 7 months ago
Matt Davis ff6998f2b9
Switch to stackwalk caller ID (#85095)
* See changelog fragment for most changes.
* Defer early config warnings until display is functioning, eliminating related fallback display logic.
* Added more type annotations and docstrings.
* ansible-test - pylint sanity for deprecations improved.
* Refactored inline legacy resolutions in PluginLoader.

Co-authored-by: Matt Clay <matt@mystile.com>
7 months ago
Jordan Borean e4cac2ac33
Add win_script become tests (#85079) 7 months ago
Brian Coca 9f894b81c2
ensure predictable permissions on module artifacts (#84948)
and test it!
7 months ago
Martin Krizek cff49a62ec
dnf5: avoid generating excessive history entries (#85065)
Fixes #85046
7 months ago
Martin Krizek dbf131c07d
async_status: fix example to use finished test (#85066)
Fixes #85048
7 months ago
Matt Clay 0aa8afbaf4
ansible-test - Use `-t` for container stop timeout (#85019) 7 months ago
Brian Coca aab732cb82
show internal but not hidden config options, while still hiding test options (#84997) 7 months ago
Brian Coca 8ab342f8cc
These actions do not support until (#84847) 7 months ago
Matt Davis 03181ac87b
Implement TaskResult backward compatibility for callbacks (#85039)
* Implement TaskResult backward compatibility for callbacks
* general API cleanup
* misc deprecations

Co-authored-by: Matt Clay <matt@mystile.com>

* fix v2_on_any deprecation exclusion for base

---------

Co-authored-by: Matt Clay <matt@mystile.com>
7 months ago
Matt Davis 2033993d89
restore parsing/utils/jsonify.py (#85032) 8 months ago
Abhijeet Kasurde 1daa8412d5
comment: raise an exception when an invalid option is provided (#84984)
Co-authored-by: Matt Clay <matt@mystile.com>
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Brian Coca 2cbb721f6f
normalize error handler choices (#84998)
use existing to avoid deprecation cycle
normalize test too
8 months ago
Matt Clay e6dc17cda4
Increase galaxy test publish timeout (#85016) 8 months ago
Lee Garrett 5f6aef95ac
Fix test_range_templating on 32-bit architectures (#85007)
* Fix test_range_templating on 32-bit architectures

32-bit archtectures like i386, armel, armhf will fail with the error

ansible._internal._templating._errors.AnsibleTemplatePluginRuntimeError: The
filter plugin 'ansible.builtin.random' failed: Python int too large to convert
to C ssize_t

So just pick sys.maxsize (2**31 - 1) so it works on 32 bit machines.

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
Co-authored-by: Matt Clay <matt@mystile.com>
8 months ago
Matt Davis 1b6b910439
Miscellaneous fixes (#85012)
* Add help_text to play_hosts deprecation

* clean up TaskResult type handling
8 months ago
Matt Clay f7d03474a5
Disable retries on ansible-galaxy-collection (#85013) 8 months ago
Sloane Hertel 93e6f012cb
Remove unused local function _get_plugin_vars from vars manager (#85008) 8 months ago
Matt Clay 6cc97447aa
Miscellaneous DT fixes (#84991)
* Use `_UNSET` instead of allowing `ellipsis`

* Fix deprecation warning pre-check

* Deprecation warnings from modules can now be disabled.
* Deprecation warnings from modules get the "can be disabled" notice.

* Include help text in pre-display fatal errors

* Simplify lookup warning/debug messaging

* Fix return type of `timedout` test plugin

* Use `object` for `_UNSET`

* Remove obsolete `convert_data` tests

* Remove unnecessary template from test

* Improve legacy YAML objects backward compat

* Fix templar backward compat for None overrides
8 months ago
Matt Clay e094d48b1b
Disable parallel publish in galaxy test (#85000) 8 months ago
Abhijeet Kasurde 500a4aba08
filter_core integration test - remove Python 2.6 related dead code (#84985)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Martin Krizek 4868effc71
get_bin_path('ssh-agent'): required is deprecated (#84995) 8 months ago
Felix Fontein 352d8ec33a
ansible-doc: fix indent and line wrapping for first line of (sub-)option and (sub-)return value descriptions (#84690)
* Fix initial indent for descriptions of suboptions.
* Fix line width for initial line of option descriptions.
8 months ago
Matt Clay 9ddfe9db39
Convert DT issue template to pre-release template (#84982) 8 months ago
Matt Davis 35750ed321
Templating overhaul, implement Data Tagging (#84621)
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
8 months ago
Brian Coca 6fc592df9b
Fix uninstall tests (#84973)
match file name to package_manager detection of dnf5
8 months ago
Matt Clay 3d30e05bb4
ansible-test - Improve runme.sh error handling (#84972) 8 months ago
Abhijeet Kasurde c54ff7de41
Filter: add support for URL-safe encoding/decoding in b64* (#84949)
* Added support for URL-safe decoding into b64decode
* Added support for URL-safe encoding into b64encode

Fixes: #84147

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Martin Krizek 244c2f06ed
Add ssh-agent launching, and ssh-agent python client (#84754)
* Add ssh-agent launching, and ssh-agent python client

* Move things around, is this better??

* docs

* postpone creating dir after bin lookup

* fix method name

* changelog ssh agent

* address reviews

* fix typing

* do not redefine public_key

* typing

* more typing

* Catch OSError when starting ssh agent

* likely copy pasted old code

* var type fix

* why is this needed?

ci_complete

* ignoring the change for now

* write out pub key file atomically

* defensive timeout for the socket

* _populate_agent docstring

* do not allow setting these in config

* check expected length before slicing blobs

* test all key types

* remove lock/unlock functionality

* docstring

* private _ssh_agent

* .

* launch agent in cli and ansible_ssh_*

* additional info for ssh-agent comment

* Add tests for remove and remove_all

* comment on os.rename

* hopefully mitigate agent startup/delays problems

* exceptions

* unused import

* fix sanity

* perf

---------

Co-authored-by: Matt Martz <matt@sivel.net>
8 months ago
Abhijeet Kasurde fcdf0b80b3
git: Document security risk involved in embedding user creds (#84963)
* Provide warning to user about the potential risk involved in
  embedding username and password in git URL while checking out the source.

Fixes: #84557

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Abhijeet Kasurde 82e4b469f6
respawn: Update ENV dict copy with PYTHONPATH value (#84962)
* Use shallow copy of os.environ to update PYTHONPATH value
  instead of using '|' operator

Fixes: #84954

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Brian Coca 4bc4030988
ansible-pull fix adhoc output inconsistencies on changed (#84869)
Two fixes for single bug:
  - ignore callback changes for adhoc
  - allow 'yaml' change matching
---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
8 months ago
Matt Martz fd76cc2821
Revert "basic: remember the user sensitive information to use later (#84699)" (#84959)
This reverts commit 19e9f3dae2.
8 months ago
Alexandre Morignot 16db3fe6c9
fix typo (#84955) 8 months ago
Abhijeet Kasurde 5347d4d4fc
distro: detect debian for OS_FAMILY for LMDE 6 (#84941)
Fixes: #84934

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Matt Clay 8b0c4825ae
Pin `wheel` to resolve build issues (#84943) 8 months ago
Brian Coca 72909599f6
pipelining fxies (#78111)
Moved check to connection as it should be the final decider
Added property to become plugins to indicate support
Also removed hardcoded su exception
Added tty detection logic for ssh (pipelining won't work if tty is needed or forced)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
8 months ago
Matt Martz a01e58cae3
Support prompt matching with ssh_askpass (#84927) 8 months ago
Abhijeet Kasurde 19e9f3dae2
basic: remember the user sensitive information to use later (#84699)
* Git allows embedding username and password in repo URL for
  https authentication. This may lead to exposing the user sensitive
  information to logs and unautheticated users.
  Adding no_log will partially solve this.
* Added documentation warning user about URL embedded with username
  and password.
* Added logic to remember user sensitive information for later sanitization

Fixes: #84557

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Matt Martz 6a274d8456
Handle forwarded exceptions from dnf5-5.2.13 (#84933) 8 months ago
Matt Clay 462affa7c4
Clean up interpreter discovery (#84394)
* Clean up interpreter discovery

- Deprecated `auto_legacy` and `auto_legacy_silent`
- Removed obsolete platform fallback config and logic
- Replaced unit tests with integration tests
- Increased test coverage
8 months ago
Jordan Borean b7d76a93b2
Fix up coverage with async on Windows (#84917)
Fixes the coverage collection for Windows and async tasks. This ensures
the async task still has access to the PSHost so that it can access the
runspace debugger tasks on the host.
8 months ago
Matt Martz 390e112822
Support download_url without a scheme:host (#84767)
* Support download_url without a scheme:host. Fixes #84213

* Support properly rebuilding pagination links. #84765

* Don't permit non absolute pagination links

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
8 months ago
Matt Martz 183c695be1
Fix errant warning about client_secret and access_token (#84916) 8 months ago
Matt Clay 399d2841c8
Add fallible 2025.4.1 to issue template (#84915) 8 months ago
Abhijeet Kasurde 2a4b1c8248
ansible-config: Dump galaxy server config in proper JSON format (#84912)
Fixes: #84840

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Jordan Borean 7d0886457a
Windows Exec Runner Update (#84868)
Updates the Windows exec runner in preparation for the WDAC changes.
This new process is designed to improve the way modules are run by
Windows and expose common functionality to run PowerShell code in a
common environment. It also includes futher changes to improve the error
handling to make it easier to see where an error occurred in the running
code.
8 months ago
Matt Clay b3d21e3ad2
Fix apt and dpkg_selections tests (#84900)
* Fix apt and dpkg_selections tests

The tests now support aarch64.
They also have reduced dependencies on URLs hosted on third-party servers.

* Skip tests on unsupported platforms

* Use same package version for both tests

* Fix multi-arch support for Ubuntu 22.04
8 months ago
Matt Clay 87422526f5
Expand tests for apt_repository (#84904) 8 months ago
Felix Fontein b9e35d66c4
Fix markup for config variable reference. (#84901) 8 months ago
Ruchi Pakhle 3607f01521
Improve vault filter documentation with clearer examples (#84896)
Fixes: #83583

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Martin Krizek e66aaa66a5
Improve performance of including tasks into the play (#84445)
* Improve performance of including tasks into the play

PlayIterator.add_tasks is used to insert tasks from an include into the
play for particular host. It makes a copy of the current block including
the tasks within the block and inserts the new tasks from the include
into the copied block. But there is no need to make copies of tasks
within the block, what we want is a "shallow" copy of the block. This
PR changes that to copy the block excluding the tasks within.

On a contrived playbook with 50 include_role tasks, each role has 1 task,
running on 10 hosts the running time is reduced from ~55s to ~44s in my
environment.

ci_complete

* Add changelog
8 months ago
Abhijeet Kasurde 5280850130
find: skip ENOENT while enumerating files (#84877)
* skip 'no such file or directory' error code while files and
  directories and report them.

Fixes: #84873

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
8 months ago
Anvit Pusalkar 1e5aac7b4f
Set IPv4 and IPv6 simultaneously (#84829) 9 months ago
Matt Clay e53c12fe2b
ansible-test - Update base/default containers (#84874) 9 months ago
Brian Coca 3690819ee8
Fix wait_for examples (#84870)
connection: local is wrong as configured remote python does not always match controller
missing the timeout to wait 300s before error
9 months ago
Matt Clay f4aafe1a94
ansible-test - Update pylint requirement (#84872) 9 months ago
Matt Clay 35665db4ed
Miscellaneous integration test fixes (#84871) 9 months ago
Matt Clay 091994a477
ansible-test - Update sanity test requirements (#84866) 9 months ago
Matt Clay b7a5411d8b
ansible-test - Improve pep8 compat with black (#84867) 9 months ago
Matt Clay 7e7946b60d
Require Jinja2 3.1.0 or later (#84864) 9 months ago
Matt Clay ad5cf37625
Add typing_extensions for core unit tests on <3.11 (#84865) 9 months ago
Brian Coca 0d4f00f5c8
needed intesect, not difference (#84839)
fixes #84750

Added tests to verify output when using smart + others
9 months ago
Robert Muir 61a6222e0e
uri: form location correctly from relative redirect (#84541)
* uri: form location correctly from relative redirect

Previously, the original URL would be combined with the relative location incorrectly, especially for URL of any complexity.

Add simple tests demonstrating the problem that fail without the fix

* fix pylint error, import the method similar to other uri methods

* add changelog fragment

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
9 months ago
Jordan Borean 101e2eb19a
windows async - refactor async wrapper code (#84712)
Refactor the async wrapper and watchdog scripts for Windows. This
attempts to avoid WMI on connection plugins that allow breaking away
from a job like winrm and ssh as an optimisation and changes how WMI is
used so that we can get the error details on a failed process more
easily.

These changes are being made also in preparation for the WDAC
implementation that requires this new execution model where input needs
to be provided through stdin.
9 months ago
Abhijeet Kasurde 611d8bdde3
doc-build: fix doc builds (#84852)
Fixes: #84849

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
9 months ago
Abhijeet Kasurde ac43e40904
darwin: simplify the fact code (#84848)
* Follow up for code review on #84779

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
9 months ago
Matt Martz 8127abbc29
Don't inherit stdio (#82770) 9 months ago
Matt Martz 3684b4824d
Remove reliance on `sshpass` and utilize `SSH_ASKPASS` (#83936)
* Add SSH_ASKPASS as an alternative means to provide ssh with passwords
9 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) 2e7e5b65e7
🧪 Drop venv when making coverage XML @ CI
This deletes the fallback that would use `--venv` when `--docker` is
unavailable in `ansible-test`. But this option is present in all
supported versions of Ansible as it was added in v2.12 which is EOL
already.

PR #84819
9 months ago
Martin Krizek 9821a4de2f
pipe/lines: simplify explanation for need for quotes (#84816)
* do not mention subprocess.Popen, it is an implementation detail
* use "shell injection vulnerability" to describe the problem that is
  well-known, or easily searched for on $search_engine and do not link
  to a 3rd-party site that is also specific to a tool for Python
9 months ago
Matt Clay 4efb01c2f3
ansible-test - Replace FreeBSD 13.4 with 13.5 (#84812) 9 months ago
Martin Krizek f11dfa7cce
dnf5: use new pkg_gpgcheck option, fallback to deprecated one (#84791) 9 months ago
Matt Clay 44966cb8e2
Update Fallible issue template (#84808) 9 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) df08ed3ef3
🔥 Remove Python 2 datetime compat fallbacks
This patch marks the `ansible.module_utils.compat.datetime` module as deprecated, including `UTC`, `utcfromtimestamp()`  and `utcnow` shims that it provides, scheduling its removal for v2.21.

It also replaces any uses of the compatibility helpers with non-deprecated calls to CPython stdlib.

PR #81874

Co-authored-by: Matt Clay <matt@mystile.com>
9 months ago
Abhijeet Kasurde 50b4e0d279
facts: use pagesize for darwin (#84779)
Fixes: #84773

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
9 months ago
Egor Budyukin fc71a5befd
Added Popen warning to lines.py documentation (#84806) 9 months ago
Martin Krizek 7fbaf6cfcf
dnf5: fix is_installed check for provided packages (#84802)
Fixes #84578
9 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) 7e0d8398ff
Implement an informative reporter for `resolvelib`
Prior to this change, when the dependency resolver started looping over multiple versions of the same collection due to backtracking, it might take a lot of time to consider and disregard tens or hundreds of versions. But to the end-user, it looks like “nothing is happening, the program is *stuck*”. Even worse if such a time-consuming backtracking hits multiple collections and it “hangs” for longer cumulative period of time.

This patch improves the perceived responsiveness by printing out informational messages with the current status whenever the backtracking for a collection happens for the first, the eighth and the thirteenth times. The last message also reminds them that they can interrupt the process and attempt to adjust the constraints.

In debug mode, it also shows what caused conflicts leading up to candidate rejections. But this is only available with `resolvelib >= 0.9.0`.

The improvement is heavily inspired by https://github.com/pypa/pip/commit/9731131.

PR #81709

Co-Authored-By: Jordan Borean <jborean93@gmail.com>
9 months ago
Martin Krizek 09391f38f0
dnf tests: unique environment/group name (#84785)
Prevents `Group state for \"customenvgroup\" not found` error which may
or may not be a regression in dnf5. Just name groups/envs uniquely to
workaround the issue.
9 months ago
Matt Clay c02ad3516f
Adjust fallible issue template (#84776)
This should provide missing details the bot is looking for.
9 months ago
Abhijeet Kasurde 532e3ea3ec
test: error handling in include_role (#84737)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
9 months ago
Matt Martz 9bed0413ec
Deprecate the paramiko connection plugin. Fixes #83757 (#84727) 9 months ago
Matt Martz 00067f1d2e
Limit respawn to supported python versions (#83662)
* Limit respawn to supported python versions
9 months ago
Matt Clay 96a8c04207
Add issue template for Fallible Data Tagging (#84766) 9 months ago
Matt Clay 9ef623a517
Integration test cleanup (#84763)
This brings in integration test fixes from the data tagging PR which are unrelated to DT changes.
9 months ago
Abhijeet Kasurde 650ee5abf8
core: update b64encode and b64decode doc (#84757) 9 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) 4a710587dd
🧪 Add macOS 15.3 to CI and `ansible-test` (#84665) 9 months ago
Matt Clay 5ff8d093f0
ansible-test - Code style cleanup (#84749)
* ansible-test - Minor style cleanup (add blank lines)

* ansible-test - Use `"""` instead of `'''`
9 months ago
Jordan Borean e9e6001263
winrm - Remove pexpect kinit code (#84735)
Removes the use of pexpect in the winrm connection plugin and rely on
just subprocess. In the past pexpect was used for macOS compatibility so
that it could handle the TTY prompt but after testing it seems like
subprocess with `start_new_session=True` is enough to get it reading
from stdin on all platforms. This simplifies the code as there's no
longer an optional library changing how things are called and will work
out of the box.
9 months ago
Matt Clay bddb9a7490
ansible-test - Support target testing with black (#84744) 9 months ago
Matt Clay 989e583356
ansible-test - Initial support for black in core (#84741) 9 months ago
Matt Martz 2a3c93f593
Deprecate strategy plugins (#84728)
* Deprecate strategy plugins. Fixes #84725
10 months ago
Jordan Borean e5ec1ee76c
Windows - Support WDAC Audit Mode (#84730)
Fix up bug when attempting to run any module on a Windows host that has
been configured with WDAC and Dynamic Code Security in audit mode. This
does not enable WDAC support with signed scripts so Ansible will still
not pass the audit events but it no longer fails to run.
10 months ago
Jordan Borean a742e20fca
ansible-test validate-modules - fix ps util checks (#84610)
* ansible-test validate-modules - fix ps util checks

Fix the module util import checks done by `ansible-test sanity --test
validate-modules` to support the newer `#AnsibleRequires` import
statement and `-Optional` flag.

* Fix sanity issues
10 months ago
Lee Garrett d21788a9b4
Fix integration tests on debian (#84379)
* Simplify conditional for service_facts integration test

This test requires systemd, so just test for that. Also fixes running this on
Debian testing/unstable releases, where ansible_distribution_version is "n/a".

* Clean up after service_facts integration test

* Simplify set_fact in interpreter_discovery_python test

Those vars are always set, either to something discovered, or "n/a". There are
no evaluations against the value "unknown".

* interpreter_discovery_python: Fix Debian test

Debian doesn't set VERSION_ID in /etc/os-release on pre-releases, see
https://bugs.debian.org/1008735

ansible 2.17 onwards does not support python 2.7 anyway.

* fix deb822_repository integration test failure on Debian

* Fix integration test hostname for Debian

* Fix integration test mount_facts

Some VMs might only have a single mount point, so they only have a single UUID.

* Add package deps for integration test subversion

/usr/bin/htpasswd is shipped in apache2-utils and needed by the main playbook.

* Fix integration test "service" on Debian sid

Debian sid does not set ansible_distribution_version, as such any tests assuming
it's a numeric value will fail. Since this is ancient test code that predates
ansible_service_mgr, remove the error-prone heuristic and rely on that var
instead.

* Fix service integration tests not running on *BSD

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
10 months ago
Martin Krizek 7a091bf486
Ensure implicit flush_handlers have a parent block (#84709)
* Ensure implicit flush_handlers have a parent block

To avoid getting tracebacks when calling methods like ``get_play()`` on
them.

* task needs to be copied

* copy only when necessary
10 months ago
simonLeary42 55e9e21ded
better error message for malformed documentation (#84705)
No the file name that caused the error will be apparent
---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
10 months ago
Martin Krizek cc30f25c42
Make timeout on become an unreachable error (#84589)
* Make timeout on become an unreachable error

Fixes #84468
10 months ago
Abhijeet Kasurde 478806e668
Minor typo fixes (#84714)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
10 months ago
Matt Davis 5d7b8288f8
Fix local connection and become issues (#84700)
* Fixed various become-related issues in `local` connection plugin.
* Fixed various issues in `sudo` and `su` become plugins.
* Added unit and integration test coverage.

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <nitzmahone@redhat.com>
10 months ago
Martin Krizek a4d4315d37
non-confrontational by default (#84707) 10 months ago
Felix Fontein ea2fe793aa
Extend description for meta refresh_inventory (#84691)
* Link to amazon.aws.aws_ec2 inventory plugin.

* Mention that refresh_inventory does not update the selected hosts for a play.

* Address comments by bcoca.

* Apply suggestions from code review

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Brian Coca fd30ba8ce0
clarify check_mode (#84703)
fixes #84701
10 months ago
Abhijeet Kasurde b27b8068f9
re: maxsplit is now keyword argument (#84702)
* Passing maxsplit and flags as positional arguments is deprecated in
  3.13.

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
10 months ago
Martin Wilck 21492e27fa
Add openSUSE MicroOS to SUSE family list (#84685)
* Add openSUSE MicroOS to SUSE family list

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Abhijeet Kasurde 411b7985a5
test: Enable group tests for Alpine (#84652)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Abhijeet Kasurde d0110ff691
test: enable user test for alpine (#84644)
* test: enable user test for alpine

* Disable user home update tests

* Disable some more tests which are not applicable for Alpine

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Sloane Hertel d049e7b1b3
fix broken ansible-galaxy-collection resolvelib test (#84626) 10 months ago
Sloane Hertel a086c34a91
linear - don't treat end_role as a run_once task (#84673) 10 months ago
Nuno Silva 8d65900974
template: update links to docs (#84689)
Changed the URL to Jinja project
10 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) cdb1ce000a
Fix `is_pinned` property of `Requirement` (#81812)
Previously, requirement version specs starting with `!=` were
incorrectly considered as pinned release requests because the
comparison was being made against a one-char string while the
operator is two-char. This patch changes the check to test against `!`
which is enough to detect this case.
10 months ago
Sloane Hertel 333ee8d010
Test include_vars reserved variable matching (#84678)
* Add test case for include_vars

* Revise test to catch erroneous warnings
10 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) ee49adfaf4
🧪🔥 Delete the `egg-info` integration test (#84686)
Previously, the integration test depended on luck. `setuptools` used
to be bundled in Python stdlib's `ensurepip`. Python 3.12 and newer no
longer include it. This test imports `pkg_resources` that is a part of
`setuptools`, meaning that it'll run out of luck at some point, under
newer Python runtimes.

This test does not seem to be useful to us so instead of fixing it, we
remove it from the repo [[1]].

Supersedes #84681.

[1]: https://github.com/ansible/ansible/pull/84681#discussion_r1945525317
10 months ago
Sammy Hori 6724e076dd
Fix 1GB example in `human_to_bytes.yml`
Fixed an incorrect example, where the expected output given had evidently been copied from an earlier example accidentally.

PR #84684
10 months ago
Matt Clay f3ccd78cce
ansible-test - Update base/default containers (#84670) 10 months ago
Matt Clay cd881bf71e
ansible-test - Add pytest-mock to mypy sanity test (#84669) 10 months ago
Matt Clay 7594243fc0
ansible-test - Update sanity test requirements (#84667) 10 months ago
Matt Clay 21bc1d915d
ansible-test - Fix warning message grammar (#84666) 10 months ago
Matt Clay 4b38456e4f
ansible-test - Correct CLI arg type and annotation (#84664) 10 months ago
Matt Clay 4cc47307ef
Use separate venvs for each release command (#84641)
This avoids requirements conflicts between different commands invoked by the release tool.
10 months ago
Matt Davis a6b5861c53
add lightweight core issue template for bot-ignored issues (#84638) 10 months ago
Dominique Quatravaux 48d71ba3aa
[fix] `warn_if_reserved` expects a list (#84624)
Fixes #84623
10 months ago
Abhijeet Kasurde 8290912eb1
service_facts: skip unwanted lines in openrc output (#84622)
* rc-status commands returns unwanted lines with service names
  and their status. Skip such lines while parsing service names

Fixes: #84512

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Abhijeet Kasurde 6db6d1967e
connection: raise exception return by SSH (#84592)
Fixes: #58133

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Matt Clay ce392dd86e
Revert "generator: add support for extra vars usage (#84544)" (#84619)
This reverts commit 186c716af1.
10 months ago
Abhijeet Kasurde e6adddcaf8
debug: hide loop variables while using var (#84597)
Fixes: #65856

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Abhijeet Kasurde 03d6209862
apt_key: fix module names in docs (#84588)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde c9097f73a2
uri: Handle HTTP exception raised (#84015)
* Handle HTTP exceptions raised when reading the content
  such as IncompleteRead

Fixes: #83794

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde 186c716af1
generator: add support for extra vars usage (#84544)
* generator: add support for extra vars usage

Fixes: #83270

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* CI green

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Review requests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Review requests II

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Brian Coca 4953fc7b26
Apt key bye (#84555)
* apt-key module updates due to debian removal

Still kept for now for backwards compat, but removing from testing when not present
And adding more explicit mesasges to errors to point to new module

* added docs and error msg

* clog

* aslkdfj

* no docs to document doc changes

* also add warning to apt_repository

* clog on apt_repo too

* fix string concat

* Apply suggestions from code review

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

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde 689c047e3a
Update win_dirname and win_basename docs (#84587)
* Updated docs and examples for win_dirname and win_basename for UNC path

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde b51ec9412e
cache: deprecated API first_order_merge (#84568)
* deprecated legacy method first_order_merge

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Brian Coca df7e1befb4
stdout callback first comment (#84533)
so we know its a rule, not just implementation accident
11 months ago
Martin Krizek 3b6d086f5e
targets/handlers: fix incorrect test cmd (#84567) 11 months ago
Jordan Borean 8c5e33cd3a
Ansible.Basic - Fix required_if check (#84562)
Fixes the Ansible.Basic `required_if` check when the option to check is
either unset or explicitly set to null.
11 months ago
Jordan Borean f86c58e2d2
ssh - Improve CLIXML stderr parsing (#84569)
Improves the logic for parsing CLIXML values in the stderr returned by
SSH. This fixes encoding problems by having a fallback in case the
output is not valid UTF-8. It also can now extract embedded CLIXML
sequences in all of stderr rather than just at the start.
11 months ago
Brian Coca 3398c102b5
reserved vars, avoid gather_subset (#84575) 11 months ago
Brian Coca 675d7201d8
fix template (#84563)
also fix gather_subset warning and add some comments/notes
---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Max Gautier 35a712588e
filters/flatten: fix input documentation (#84477)
Flatten input is a list, not a dictionary.
11 months ago
Sloane Hertel ad93b96750
host_group_vars - remove unnecessary os.path.join cache (#84549) 11 months ago
Lee Garrett 3030c79331
user: Fix homedir permissions when UMASK is unset in /etc/login.defs
When a user doesn't exist and user module is used to create the user and the
homedir, adduser is called which parses HOME_MODE from /etc/login.defs, and when
not set calculates the mode from UMASK from the same file.

When a user already exists without homedir, and the user module is used to add a
home dir, it incorrectly ignores HOME_MODE, resulting in a world-readable home
dir when UMASK is not set. This is for example the case in Debian trixie and
later, and likely Ubuntu 25.04 and later.


Signed-off-by: Lee Garrett <lgarrett@rocketjump.eu>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Matt Clay 5623a386c1
Fix unit and integration tests (#84554)
This is a follow-up to https://github.com/ansible/ansible/pull/84473
11 months ago
Matt Clay 7677bf1c9b
ansible-test - Use urllib intead of curl (#84551)
Also added automatic retries on HTTP request exceptions, since all currently implemented methods (GET/PUT/DELETE) are idempotent.
11 months ago
Brian Coca a046ef5a95
fix incongruent ansible-vault cli options (#84494)
prompt now only errors if stdin is specifically triggered and not due to lack of other args

fixes #84489
---------

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
11 months ago
Lee Garrett 73180c0630
ansible-vault integration test fix (fixes: #83837) (#84486)
Correct the test that expects an error when using ansible-vault to write against
a non-writeable dir. Skip the test as root, as root can always write.

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
11 months ago
Abhijeet Kasurde 5b0d170496
get_url: add support for BSD-style digest (#84485)
* Added support for BSD-style digest file to test
  checksum of downloaded file.

Fixes: #84476

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Kristopher Newsome f727d74fc2
Allows iptables chain creation with wait parameter (#84491)
* Allows iptables chain creation with wait parameter

Fixes #84490

* Add the changelog fragment for 84490
11 months ago
Abhijeet Kasurde 8588401387
User: Update prompt for SSH key passphrase prompt (#84521)
* update prompt for SSH key passphrase prompt
* introduce timeout in SSH key passphrase interaction

Fixes: #84484

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Harilou d79b706c06
fix[doc.py]: path will be undefined (#84464)
* fix[doc.py]: path will be undefined and a direct reference will throw an UnboundLocalError.

If none of the files in files exists, path will be undefined and a direct reference will throw an UnboundLocalError.
Repair function file parameter type annotation is inaccurate

* Update changelogs/fragments/fix-cli-doc-path_undefined.yaml

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>

---------

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
11 months ago
simonLeary42 e151cd765d
`with_dict` type error include value in error message (#84473)
* with_dict better error message

* include type in error message

* changelog fragment

* Update lib/ansible/plugins/lookup/dict.py

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

* specific wording

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Martin Krizek 4c30e8b6cf
.github: simplify PR templates (#84536)
It is rare that we need to provide information like "before and after
the change". In majority of cases we just ignore "Additional
information" when submitting PRs. We can just put the needed information
into the summary if needed and remove the section from the template,
simplifying it.
11 months ago
Felix Fontein ae55f874a0
Enforce FQCNs in seealso plugin/module entries. (#84325) 11 months ago
Abhijeet Kasurde 508c4dc93e
Update ticketing stubs (#84535)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Felix Fontein 60e2135c2b
Bump acme test container to 2.3.0 (#84547) 11 months ago
xzeck 40d364985d
host_group_vars - fix Python API traceback caused by undefined 'key' variable (#84488)
Fixes:

Traceback (most recent call last):
  File "/home/shertel/ansible/lib/ansible/plugins/vars/host_group_vars.py", line 139, in get_vars
    FOUND[key] = found_files = loader.find_vars_files(opath, entity_name)
          ^^^
UnboundLocalError: cannot access local variable 'key' where it is not associated with a value

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/shertel/ansible/lib/ansible/plugins/vars/host_group_vars.py", line 151, in get_vars
    raise AnsibleParserError(to_native(e))
ansible.errors.AnsibleParserError: cannot access local variable 'key' where it is not associated with a value
11 months ago
Matt Clay eb475e23f7
ansible-test - Update utility containers (#84545) 11 months ago
Brian Coca 20baf29a2a
fix warnings about reserved variable names to cover all sources (#84432)
Also remove redundant check from tqm
Now covers module output (set_fact/include_vars)
Includes play objects at any stage (tasks that error were not covered)
Added tests, moved them to role structure
11 months ago
Matt Clay 96f7090acc
Use ECR Public for container test (#84537) 11 months ago
Brian Coca 477433c5ba
constructed, let users know some limitations (#84510)
* constructed, let users know some limitations

reasons https://forum.ansible.com/t/debugging-constructed-inventory-constructing-group-from-values-of-host-variables/39443

* fix indent

* Update lib/ansible/plugins/doc_fragments/constructed.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* updated as per fb

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
11 months ago
simonLeary42 64cbb71e6e
FIX get_options function for CallbackBase (#84496) 11 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) ed250ecd0a
📝 Update the outdated WGs+community links in GH issues (#84523)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
11 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) ecadbc6354
📝 Drop drop-down default note from issue forms (#84524)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
11 months ago
Matt Clay 3b77277428
ansible-test - Fix FreeBSD instance CA certs (#84529)
Some versions and architectures come with `ca_root_nss` pre-installed.
However, at least FreeBSD 13.4 on aarch64 does not.
This change ensures the certificates will always be installed.
11 months ago
Matt Clay 1b3face065
ansible-test - Replace FreeBSD 14.1 with 14.2 (#84527)
* ansible-test - Replace FreeBSD 14.1 with 14.2

* Remove cron faketime testing from FreeBSD
11 months ago
Matt Clay f552fe2c15
ansible-test - Replace RHEL 9.4 with 9.5 (#84526) 11 months ago
Matt Clay 35c4b58c11
ansible-test - Replace Alpine 3.20 with 3.21 (#84525) 11 months ago
Matt Clay 648dcd3a6a
ansible-test - Replace Fedora 40 with 41 (#84281)
* ansible-test - Replace Fedora 40 with 41

Also update other distro containers to remove unnecessary packages:

* apache2
* subversion
* ruby

* Fix subversion test on Ubuntu

Also remove obsolete vars files from subversion test.

* Skip dnf test on Fedora 41+

The dnf5 test is all that is needed.

* Support dnf5 for the package test

* Extend unix-chkpwd work-around for Fedora
11 months ago
Matt Martz 3a33d8a4c1
Add Keycloak service account auth capability to ansible-galaxy (#83145) 11 months ago
Matt Clay 91f4b71d40
Fix uri integration test on Python 3.13 (#84518) 11 months ago
Matt Clay eb6d581286
ansible-test - Update nios-test-container to 7.0.0 (#84517) 11 months ago
Matt Clay 5ec236b564
Fix result_pickle_error integration test (#84506)
The test has been updated to use a custom type which does not support pickling,
instead of relying on Jinja's `Undefined` type. As of Jinja 3.1.5 that type now
supports pickle, which breaks the original implementation of the test.
11 months ago
Abhijeet Kasurde f72aa1dc0c
test: Update regex for required and default in FieldAttributes (#84209)
Fixes: #61460

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Rob Garcia db44fc58ec
Added docstrings to V2 methods in the CallbackBase Class (4 & 5 of 27) (#83507)
* Added docstrings to V2 methods in the CallbackBase Class (4 & 5 of 27)

* Made corrections as requested by webknjaz.

* Cleaned up whitespace issues.

* Corrections to customization note for review by webknjaz.

* Added rtype to return in docstrings.

* Simplified docstrings.


Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
11 months ago
M Norrby cae4f90b21
Add documentation for non-numeric cron scheduling values (#84396)
- Document vixie cron compatible non-numeric values
- State which parameters cannot be used together with special_time
12 months ago
Brian Coca c64c389007
gather_facts, fix 'smart' handling with network os and 'setup' (#84425)
gather_facts, fix network_os and smart logic and defaults

setup will be default for smart only if network_os is not set, now you get warnings and errors when missing a valid facts module for a network os

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
12 months ago
Abhijeet Kasurde 01ca9b1d0e
uri: move follow_redirects to module_utils (#84442)
* url lookup and uri module shares follow_redirects parameter,
  moving it module_utils code.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
12 months ago
David Lassig 106909db8b
adding option for form-multipart data to switch multipart encoding (#80566)
* adding option for form-multipart data to switch multipart encoding from default base64 to 7or8bit encoding

Co-authored-by: davlas <david.lassig@bwi.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
12 months ago
Brian Coca 3fffddc183
Added None/empty notes to regex_search (#84437) 12 months ago
Matt Martz 73d8f4ad46
Make sure we are always using Lock from our multiprocessing context (#84453)
* Make sure we are always using Lock from our multiprocessing context

* add clog frag
12 months ago
spyinx 563906687b
Fix a debug message error (#84426) 12 months ago
Brian Coca 3c91eab0d8
copy, prevent internal options in task (#84422)
* copy, prevent internal options in task

fixes #84367
12 months ago
Sloane Hertel f0f5d7f88b
simplify copy module (#84313)
* simplify redundancy with AnsibleModule set_*_if_different methods

* simplify copying a source directory to a dest directory without modifying behavior
12 months ago
Herman van Rink 363c57b311
csvfile - let the config system do the typecasting (#82263)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde ac110eb012
lookup_template: added trim_blocks option (#84254)
* Allow user to control the trimming of blocks while templating
* Added tests
* Updated documentation and example

Fixes: #75962

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 0f466bb75f
test: Remove dead code (#84436)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Stefano Rivera d500354798
unarchive: Clamp zip timestamps on 32-bit time_t (#84409)
Clamp zip timestamps to representible values when unpacking zip files on
platforms that use 32-bit time_t (e.g.  Debian i386). This is a
non-issue in practice (in 2024), but should allow the test suite to pass
on Debian i386.

We use a round value of 2038-01-01 00:00:00 for simplicity, and to avoid
running into timezone offsets closer to the actual limit.

MR #81520 introduced sanity-checking tests that used dates not
representable with a 32-bit time_t.
1 year ago
Sloane Hertel af2bb2c182
wait_for_connection - test connection=local does not emit warning (#84438)
Add test for PR 84421
1 year ago
Alex Willmer 59d9737788
fix reset_connection with templated connection variables (#84240)
* ssh: Test reset_connection with templated ansible_ssh_executable

Add failing test to confirm subsequent fixes are necessary & sufficient.

* ssh: Fix reset_connection with templated ansible_ssh_executable

Signed-off-by: Alex Willmer <alex@moreati.org.uk>
1 year ago
Fil eed6d48046
Fix `failed_when` string in the second `ansible.builtin.uri` example (#84382)
Open the double quotes at the beginning of the entire `failed_when` value.

Individual conditions work well, yet fail each time they are combined with a logic `or` (as per the example).

Double quoting the entire string solved the problem.
1 year ago
Alex Willmer e2b454f4e3
wait_for_connection: fix errant warning for local connection(s) (#84421)
This prevents "[WARNING]: Reset is not implemented for this connection" when
using wait_for_connection with localhost or other local hosts.

It's arguable (from a consistency/correctness perspective) that
`ansible.plugins.connection.local.Connection.reset()` should call
`Connection.close()`. I went for a no-op on the basis of "if it aint broke
don't fix it", and erred on the side of keeping existing semantics. However
either option would be fine with me.
1 year ago
Brian Coca 5208cffd91
document decrypt also works on strings (#84412) 1 year ago
Abhijeet Kasurde b154e38e54
config lookup, fixes and tests (#84398)
* Integration tests for lookup_config

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Lee Garrett 6d21e28c73
Fix non-root integration tests failure (#84378)
* Fix callback_default integration test for non-root users

This test compares the test output to previously collected output. However, this
previously assumed that the tests are run as root, even though needs/root in
aliases is not set.

So instead parameterize the output, and use sed to replace the value that
diverge when running it as different users.

* integration tests: Ensure temp file removal doesn't fail as non-root user

* Don't fail when ansible-galaxy integration test runs as non-root

* Update integration test callback list

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
1 year ago
Abhijeet Kasurde 1ad0c404ef
Coverage for virtual/sunos.py (#84357)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 2ca086c993
Coverage for virtual/hpux.py (#84362)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 5b231bbbdb
test coverage for virtual/sysctl.py (#84356)
* test coverage for virtual/sysctl.py

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Sammy Hori df0fe81383
Changed human_to_bytes input to a string (#84336)
For it to be a human readable description it can't be an int.
1 year ago
Abhijeet Kasurde 27aa60b8b4
Added examples for password_hash (#84322)
Fixes: #84318

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Lorenzo Bettini 5100aa3977
fix documentation about avoiding apt_key (#84326) 1 year ago
Tobi 803cf7df41
Add ansible_uptime_seconds support for AIX (#84321)
Added ansible_uptime_seconds fact for AIX

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 92cf41aa46
Additional tests for lookup_sequence (#84315)
* Additional tests for lookup_sequence

* Follow up for https://github.com/ansible/ansible/pull/83758,
  to add tests for stride parameter.
---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 9588215601
Removed deprecated include_delegate_to param (#84306)
* Removed deprecated include_delegate_to param

* Remove deprecated include_delegate_to param from
  get_vars API in manager.py

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Make ignore.txt

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Adam Williamson cf4276f560
package_facts: extend note about python3-rpm to cover Fedora 41+ (#84373)
Fedora 41 no longer has python3-rpm installed by default either,
so package_facts blows up on Fedora 41 hosts unless you make sure
python3-rpm is installed first. Not sure we can do a lot about
this besides extending this note.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
1 year ago
Jordan Borean f9b58fa13f
ansible-test - fix coverage for test modules (#84366)
Fixes the coverage path translation for modules located in integration
test paths. Instead of trying to match by the unique temporary path name
that the module is executed as, the reporting tool will translate it to
the static path that the module is actually located under.
1 year ago
Lee Garrett f2a77b071e
Test aliases fix (#84377)
* integrity tests: Tag (destructive) root tests as such

- apt_key needs root to touch the apt key database
- debconf needs root to change debconf values of system packages
- gathering writes to /etc/ansible/*, writeable only to root
- group creates system groups
- noexec mounts/umounts a ramdisk
- systemd requires root to start/stop services

Mark all except noexec as "destructive" as they change the state of the system.

* integration test cron requires root, as it calls setup_cron

* integration test dpkg_selection runs dpkg as root

* integration test facts_linux_network requires root

It adds/removes IP addresses from network interfaces, requiring root for that.

* integration test package requires root

installs/removes system packages

* Integration test service requires root

Creates/starts/stops/removes systemd services

* integration test user requires root to create users

* integration tests using setup_test_user require root

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
1 year ago
Martin Krizek 2a53b851fe
dnf5,apt: add auto_install_module_deps option (#84292)
* dnf5,apt: add auto_install_module_deps option

Fixes #84206
1 year ago
Matt Clay 95e3af3e0f
ansible-test - Improve container network detection (#84323)
When detection of the current container network fails, a warning is now issued and execution continues.
This simplifies usage in cases where the current container cannot be inspected, such as when running in GitHub Codespaces.
1 year ago
Martin Krizek c99493eb3f
dnf5 - consolidate package resolving settings (#84335)
Fixes #84334
1 year ago
Martin Krizek a27a7a27d1
dnf5: fix is_installed check (#84275)
Fixes #84259
1 year ago
Sloane Hertel 3e82ed307b
include_vars - fix including new hash variables when hash_behaviour is set to merge (#84303) 1 year ago
James Ramsaran e14f9fe725
Sequence query fix (#83758)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
1 year ago
Brian Coca c734ac2125
vars/varnames more examles more varied (#84300)
also ref each other in seealso as they will commonly be used toghether
1 year ago
Abhijeet Kasurde 32eacecca9
Deprecated libvirt_lxc_noseclabel config (#84287)
* Deprecated libvirt_lxc_noseclabel config

* deprecate moved libvirt_lxc_noseclabel config

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Make CI green I

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde ca0810da85
Add tests for deprecations (#84284)
* Check for module deprecation
* Check for module option deprecation
* Check for plugin deprecation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Brian Coca e404bc17f7
package_facts fix empty packages on foreign mgr (#83855)
* package_facts fix empty packages on foreign mgr

return the first package manager that provides output

add tests with fake rpm on apt machines
1 year ago
Jordan Borean 3befdd3d15
Fix runas become SYSTEM logic (#84280)
Fixes the logic when attempting to become the SYSTEM user using the
runas plugin. It was incorrectly assumed that calling LogonUser with the
SYSTEM username would produce a new token with all the privileges but
instead it creates a copy of the existing token. This reverts the logic
back to the original process and adds in new logic to avoid any tokens
that are restricted from creating new processes.
1 year ago
Jordan Borean 52ecd3664a
ansible-test - align 2025 connection defaults to CI matrix (#84291) 1 year ago
Matt Clay 9d249432c4
Increase scope of mypy sanity test (#84288)
* Increase scope of mypy sanity test

* Fix issues reported by mypy
1 year ago
Jordan Borean 7501bbec20
Add support for Windows Server 2025 (#84285)
Adds Windows Server 2025 to the testing matrix.
1 year ago
Brian Coca bf48b538f8
command module, fix docs to reflect reality (#84191)
though the previous docs were the 'intended' outcome,
the current behaviour has been active for a long time and should
not be removed due to backward compatibility issues.

One thing we can do going forward is deprecate substitution enabled by default.
1 year ago
Matt Clay a98801903d
ansible-test - Replace FreeBSD 13.3 with 13.4 (#84236)
* ansible-test - Replace FreeBSD 13.3 with 13.4
* ansible-test - Fix typos in bootstrap.sh
* Skip libfaketime on FreeBSD except FreeBSD 14
1 year ago
Alexei Znamensky 1d61f2a4fd
remove ignore clauses for module uri (#83642)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
1 year ago
Brandon Bennett 31cde0ebd1
user: create Buildroot subclass as alias to Busybox (#83666)
Fixes: #83665
1 year ago
Sloane Hertel 157ef04b1e
Add --flush-cache option to ansible-pull (#84211) 1 year ago
Sloane Hertel 771f7ad29c
update ansible-galaxy resolvelib requirement to >= 0.5.3, < 2.0.0 (#84218)
* Update resolvelib upperbound to 2.0.0

Minor SemVer releases should not contain breaking changes

* Test the latest minor release and reduce number of resolvelib versions tested for efficiency
1 year ago
Matt Clay 68bfa37838
ansible-test - Fix interactive cmd traceback (#84264) 1 year ago
spyinx 9cdd6e58b3
Fixed ipv6 pattern in parse_address (#84237) 1 year ago
Abhijeet Kasurde a99d66e6c7
Removed deprecated STRING_CONVERSION_ACTION (#84245)
Fixes: #84220

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Daniel Gonçalves 49b22d4d6b
Python binary should not be python at first try for env-setup.fish (#84212) 1 year ago
Matt Martz abf6036bb2
Link to role argspec docs. Fixes #84164 (#84192) 1 year ago
Abhijeet Kasurde f92e99fd8f
test: fix check_required_by (#84153)
* Update the documentation for check_required_by
* Fix return value for check_required_by (now returns empty list on success)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Matt Clay c49e94017a
Improvements for the create-bulk-issues.py script (#84235)
* Improve error handling for create-bulk-issues.py

* Add support for setting assignee

* Add example YAML to feature --help output.

* Add additional help message for token issues.
1 year ago
Sloane Hertel 32ae3ce117
Remove encrypt unit tests for undocumented algorithms, which are disallowed in 2.19. (#84219) 1 year ago
Abhijeet Kasurde 8784469b4c
encrypt: raise error on passing unsupported passlib hashtype (#84186)
* Raise an AnsibleFilterError when unsupported passlib hashtype is
  provided in do_encrypt.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
anvitpusalkar 2c6b78f516
Add --flush-cache option for ansible and ansible-console (#84149)
* Allow CLIs that accept inventory options to flush the inventory cache(s) and fact cache

Fixes #83749
1 year ago
Sloane Hertel 03acb22f99
Fix returning unreachable for looped tasks (#84049)
* Fix returning unreachable for looped tasks

Add tests for ignore_unreachable and loop
1 year ago
Sloane Hertel a3b58fb67c
Add a test using ignore_errors as a variable (#84175)
* Add a regression test for https://github.com/ansible/ansible/issues/32384
1 year ago
Abhijeet Kasurde 3a40ba3b2c
Remove deprecated pycompat24 and importlib (#84161)
* Removed deprecated pycompat24 and importlib

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Make CI green

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Ignore basic.py

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Make CI green III

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Make CI green IV

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 1b46b5923e
Change changelog type from bugfixes to removed_features (#84158)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde f29b46e438
Remove deprecated plural form of collection path (#84156)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Conner Crosby d662a8d088
Enable file module to disable diff_mode (#83700)
Several tasks within the modification_time.yml and state_link.yml task
lists have explicitly enabled diff_mode because these tests previously
assumed a diff attribute would always be returned from the file module.
1 year ago
Abhijeet Kasurde ab1a8cb3b3
docs: print deprecation collection name (#84126)
While showing the deprecation message, mention the collection name
from which the module is removed.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Matt Davis c9ac477e53
Preserve `_ansible_no_log` from action result; fix `include_vars` to set properly (#84143)
* fixes for CVE-2024-8775

* propagate truthy `_ansible_no_log` in action result (previously superseded by task-calculated value)
* always mask entire `include_vars` action result if any file loaded had a false `show_content` flag (previously used only the flag value from the last file loaded)

* update no_log tests for CVE-2024-8775
* include validation of _ansible_no_log preservation when set by actions
* replace static values with dynamic for increased robustness to logging/display/callback changes (but still using grep counts :( )

* changelog

* use ternary, coerce to bool explicitly
1 year ago
Brian Coca 11e4a6a722
user module avoid conflicts ssh pub key (#84165)
Remove pub key if we are going to generate private
fix tests for os X
1 year ago
Abhijeet Kasurde b1816880cb
Remove deprecated compat.selector (#84155)
* Removed files related to selector compat

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 1e6ffc1d02
Fixed broken tests (#84088)
* Add `match=` in pytest.raises
* Remove redundant assert statements

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Abhijeet Kasurde 1727bbecce
test: Remove unreachable tests (#83696)
variable_manager unit tests are unreachable. These tests
are already covered in integration tests.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 53ceb74e84
Use open with context manager (#83337)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Sviatoslav Sydorenko (Святослав Сидоренко) f7766cf843
Trim `selinux_policytype` @ integration tests (#84136)
The shell command sometimes prints a trailing whitespace which breaks
the tests on old RHELs. This patch is supposed to fix that.
1 year ago
Colin Watson c6e166319a
test: use password to generate random string instead of range (#84129)
* Use password lookup instead of range
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Martin Krizek 42e2f09b97
Faster host removal from a handler (#84091)
In ``Handler.notify_host`` we ensure that ``Handler.notified_hosts`` can contain
particular host at most once. Therefore for removing a host it should be
faster to use ``list.remove`` which removes the first item in the list,
as opposed to using list comprehension removing all such items.
1 year ago
Sloane Hertel 4f6276d72d
Remove configuration options that were moved to inventory plugins now that ansible-config supports plugin types. (#84130) 1 year ago
Abhijeet Kasurde 663f7f3b56
test for gathering FIPS facts (#83266)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 279de623d0
Use dict comprehension instead (#83680)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 671c797aa1
Remove unnecessary code (#84085)
* os.setsid does not return anything, so remove code which relying
  on return value

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
ShIRann Chen 58cb8ca4fa
feat: checksum_algo param for find module (#83014)
Co-authored-by: shirann <shirannx@gmail.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
1 year ago
Matt Clay 48be6f8b6f
ansible-test - Improve container probe error handling (#84109) 1 year ago
Brian Coca 6aaac6cab3
service_facts: add FreeBSD support (#82556)
new freebsd scanner using 'their version' of service cli tool
also avoid loading the linuxy service scanner when freebsd
1 year ago
Matt Clay b3950bc864
Add NoReturn annotations in module_utils (#84106) 1 year ago
Matt Clay 56bab1d097
Enable bad-docstring-quotes pylint rule for core (#84100)
* Enable bad-docstring-quotes pylint rule for core

* Ignore previously bulk update in git blame
1 year ago
Matt Clay a0495fc314
Update triple single quotes to triple double quotes (#84099)
* Update triple single quotes to triple double quotes

This change was fully automated.

The updated Python files have been verified to tokenize the same as the originals, except for the expected change in quoting of strings, which were verified through literal_eval.

* Manual conversion of docstring quotes
1 year ago
Matt Clay 62ce21b6e4
ansible-test - Work around pylint issue on 3.11 (#84094) 1 year ago
Matt Clay 83671ecb39
ansible-test - Enable pylint docstyle for tests (#84092)
This cleans up the implementation of the pylint sanity test and enables the docstyle extension rule `bad-docstring-quotes` for tests.

The rule will be enabled for the rest of ansible-core once automated cleanup has been performed on existing docstrings.
1 year ago
Matt Clay 0b661438a0
ansible-test - Update base/default containers (#84089) 1 year ago
Sloane Hertel 7e57c0fb3d
Fix copyright format for gather_facts and mount_facts as documented (#84087) 1 year ago
Matt Clay 955e310b4c
Cover unit tests with mypy (#84084)
* Added support for testing unit tests with mypy.
* Added support for ignoring individual mypy error codes.
* Added missing assert on unit tests and marked xfail.
* Added type hints for some unit tests.
* Added ignores for unit tests not passing mypy.
* Fixed incorrect autouse argument in unit test fixtures.
* Fixed minor issues causing problems with mypy in unit tests.
1 year ago
Abhijeet Kasurde 18c6b40e19
Update unique filter docs (#84078)
* Correct case_sensitive example
* Add attribute docs

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Brian Coca 0959472bc6
user module, avoid chmoding symlink'd home file (#83956)
also added tests

---------
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
1 year ago
Tinyblargon f3b956a7ef
docs: `unique` add missing settings (#84076)
add the `case_sensitive` setting
1 year ago
Martin Krizek f1f0d9bd53
PlayIterator: skip tasks from already ran roles (#83793)
... so strategies do not have to filter them.
1 year ago
Sloane Hertel d0df3a174a
ansible-galaxy - fix ignoring certs when installing from git repos (#83332)
* Fix installing collections|roles from git repos with GALAXY_IGNORE_CERTS

* Fix installing collections from git repos with --ignore-certs

* Update unit test

* Add test case
1 year ago
Matt Clay 50604e8461
ansible-test - Update astroid for pylint sanity test (#84054) 1 year ago
Matt Clay 3cf308f672
ansible-test - Disable pylint deprecated-* rules (#84050) 1 year ago
Martin Krizek 0f4f05ebe4
Implicit flush_handlers inherit play tags (#83968) 1 year ago
Sloane Hertel ee9e6130a7
Fix error message given by ansible.module_utils.facts.timeout.timeout (#83945)
* Update unit test

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
1 year ago
Matt Clay 9406ed3109
ansible-test - Update sanity tests and default Python (#83998)
* ansible-test - Update sanity test requirements
* ansible-test - Default to Python 3.13 in base/default containers
* ansible-test - Fix incorrect AnyStr type hints
1 year ago
Martin Krizek d6d2251929
Reduce number of implicit meta tasks (#84007)
This greatly reduces run time on large inventories since meta tasks are
executed in the main process sequentially and just executing them is expensive.

This change avoids running the following implicit meta tasks:
  * ``flush_handlers`` on hosts where no handlers are notified
  * ``noop`` for the linear strategy's lockstep, instead hosts that are
    not executing the current task are just not part of the current host loop

A playbook consiting of two simple plays both running on ~6000 hosts
runs in:
devel: 37s
this PR: 1.3s

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
1 year ago
Abhijeet Kasurde 02e00aba3f
file: simplify the code (#84043)
* Remove unnecessary code
* Make code simple to read

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Martin Krizek f593eb42a3
get_url: properly parse filename in content-disposition (#83748)
Since we don't really care about the type we don't have to
query for it and just retrieve the filename value.
Unfortunately we cannot use module_utils.urls.get_response_filename
as we don't have the response object, so just utilize
email.message.Message to parse the filename
instead of manually doing the work ourselves.

Fixes: #83690
1 year ago
Abhijeet Kasurde b3c4154e86
Use sentinel everywhere (#84041)
* Use sentinel everywhere

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Matt Clay 9abc651cd6
ansible-test - Update nios-test-container to 6.0.0 (#84042) 1 year ago
Alexei Znamensky bebc192c3e
remove one ignore clause for module copy (#83643)
---------
Co-authored-by: flowerysong <junk+github@flowerysong.com>
1 year ago
Jack Farzan 4c8fb12fc2
cron: return stdout and rc for cron command (#83290)
Co-authored-by: Jack Farzan <jfarzan@adobe.com>
1 year ago
Abhijeet Kasurde 79e8c4c26c
debconf: set empty password value (#83217)
Fixes: #83214

---------
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Matt Martz fb7fd51b93
Prevent condor from being installed and fulfilling libfmt dependency (#84023) 1 year ago
uber-dendy f97adb4c5d
Add additional logging for SSH runtime output timeouts and escalation messages (#84008)
Signed-off-by: Yuri Savinkin <stkwar@gmail.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Brian Coca 3d40db1ac0
INVENTORY_IGNORE_EXTS stop ignoring ini (#84001)
* INVENTORY_IGNORE_EXTS stop ignoring ini

Originally added to avoid configuration files for inventory scripts
now clashes with the much more common ini inventory files.

* add a note to script plugin

* Update lib/ansible/plugins/inventory/script.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 34f8f55d9e
facts: Skip path if the distribution path is directory (#84012)
* facts: Skip path if the distribution path is directory

Skip path if the distribution path is directory instead of file.
Handle exception raised while handling distribution path.

Fixes: #84006

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Review requests

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Martin Krizek 21fee95af7
package/dnf action plugins: better facts failure msg (#83995) 1 year ago
Matt Clay facf9186b4
Test entry points with editable install (#84002)
This allows collection of code coverage for the entry points.
1 year ago
Brian Coca 0c8efa29b2
Ansible Errors, Don't hide stacked messages when yaml (#83933)
Also remove redundant msg now that we fixed yaml case
So no more need to %s % e.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
林博仁 Buo-ren Lin 8caa32a558
split: Fix incorrect example result of the split builtin filter (#83982)
The following Python output proves that the second member of the resulting list should be " a", not "a":

```txt
$ python3 
Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> string = "jojo is, a"
>>> string.split(',')
['jojo is', ' a']
```
1 year ago
Felix Fontein f4e2e206b3
Add basic validation for action_groups (#83965)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
1 year ago
Martin Krizek 0a100c7f06
dnf5: fix tb when plugins API is not available (#83969)
Follow up on https://github.com/ansible/ansible/pull/83105
1 year ago
Matt Clay c0fb71a642
Move ansible-deprecated ignores for tests inline (#83989) 1 year ago
Matt Davis 491a87215a
zap changelogs (#83988) 1 year ago
Matt Davis 1b8bfd40ab
bump devel to 2.19 (#83985) 1 year ago

@ -31,7 +31,7 @@ variables:
- name: fetchDepth - name: fetchDepth
value: 500 value: 500
- name: defaultContainer - name: defaultContainer
value: quay.io/ansible/azure-pipelines-test-container:6.0.0 value: quay.io/ansible/azure-pipelines-test-container:7.0.0
pool: Standard pool: Standard
@ -54,12 +54,12 @@ stages:
nameFormat: Python {0} nameFormat: Python {0}
testFormat: units/{0} testFormat: units/{0}
targets: targets:
- test: 3.8
- test: 3.9 - test: 3.9
- test: '3.10' - test: '3.10'
- test: 3.11 - test: 3.11
- test: 3.12 - test: 3.12
- test: 3.13 - test: 3.13
- test: 3.14
- stage: Windows - stage: Windows
dependsOn: [] dependsOn: []
jobs: jobs:
@ -78,36 +78,40 @@ stages:
test: 2022/psrp/http test: 2022/psrp/http
- name: 2022 SSH Key - name: 2022 SSH Key
test: 2022/ssh/key test: 2022/ssh/key
- name: 2025 PSRP HTTP
test: 2025/psrp/http
- name: 2025 SSH Key
test: 2025/ssh/key
- stage: Remote - stage: Remote
dependsOn: [] dependsOn: []
jobs: jobs:
- template: templates/matrix.yml # context/target - template: templates/matrix.yml # context/target
parameters: parameters:
targets: targets:
- name: macOS 14.3 - name: macOS 15.3
test: macos/14.3 test: macos/15.3
- name: RHEL 9.4 py39 - name: RHEL 9.6 py39
test: rhel/9.4@3.9 test: rhel/9.6@3.9
- name: RHEL 9.4 py312 - name: RHEL 9.6 py312
test: rhel/9.4@3.12 test: rhel/9.6@3.12
- name: FreeBSD 13.3 - name: RHEL 10.0
test: freebsd/13.3 test: rhel/10.0
- name: FreeBSD 14.1 - name: FreeBSD 13.5
test: freebsd/14.1 test: freebsd/13.5
- name: FreeBSD 14.3
test: freebsd/14.3
groups: groups:
- 1 - 1
- 2 - 2
- template: templates/matrix.yml # context/controller - template: templates/matrix.yml # context/controller
parameters: parameters:
targets: targets:
- name: macOS 14.3 - name: macOS 15.3
test: macos/14.3 test: macos/15.3
- name: RHEL 9.4 - name: RHEL 9.6
test: rhel/9.4 test: rhel/9.6
- name: FreeBSD 13.3 - name: RHEL 10.0
test: freebsd/13.3 test: rhel/10.0
- name: FreeBSD 14.1
test: freebsd/14.1
groups: groups:
- 3 - 3
- 4 - 4
@ -115,12 +119,14 @@ stages:
- template: templates/matrix.yml # context/controller (ansible-test container management) - template: templates/matrix.yml # context/controller (ansible-test container management)
parameters: parameters:
targets: targets:
- name: Alpine 3.20 - name: Alpine 3.22
test: alpine/3.20 test: alpine/3.22
- name: Fedora 40 - name: Fedora 42
test: fedora/40 test: fedora/42
- name: RHEL 9.4 - name: RHEL 9.6
test: rhel/9.4 test: rhel/9.6
- name: RHEL 10.0
test: rhel/10.0
- name: Ubuntu 24.04 - name: Ubuntu 24.04
test: ubuntu/24.04 test: ubuntu/24.04
groups: groups:
@ -132,10 +138,10 @@ stages:
parameters: parameters:
testFormat: linux/{0} testFormat: linux/{0}
targets: targets:
- name: Alpine 3.20 - name: Alpine 3.22
test: alpine320 test: alpine322
- name: Fedora 40 - name: Fedora 42
test: fedora40 test: fedora42
- name: Ubuntu 22.04 - name: Ubuntu 22.04
test: ubuntu2204 test: ubuntu2204
- name: Ubuntu 24.04 - name: Ubuntu 24.04
@ -147,16 +153,24 @@ stages:
parameters: parameters:
testFormat: linux/{0} testFormat: linux/{0}
targets: targets:
- name: Alpine 3.20 - name: Alpine 3.22
test: alpine320 test: alpine322
- name: Fedora 40 - name: Fedora 42
test: fedora40 test: fedora42
- name: Ubuntu 24.04 - name: Ubuntu 24.04
test: ubuntu2404 test: ubuntu2404
groups: groups:
- 3 - 3
- 4 - 4
- 5 - 5
- template: templates/matrix.yml # context/target (dnf-oldest, dnf-latest)
parameters:
testFormat: linux/{0}
targets:
- name: Fedora 42
test: fedora42
groups:
- 7
- stage: Galaxy - stage: Galaxy
dependsOn: [] dependsOn: []
jobs: jobs:
@ -165,9 +179,9 @@ stages:
nameFormat: Python {0} nameFormat: Python {0}
testFormat: galaxy/{0}/1 testFormat: galaxy/{0}/1
targets: targets:
- test: 3.11
- test: 3.12 - test: 3.12
- test: 3.13 - test: 3.13
- test: 3.14
- stage: Generic - stage: Generic
dependsOn: [] dependsOn: []
jobs: jobs:
@ -176,9 +190,9 @@ stages:
nameFormat: Python {0} nameFormat: Python {0}
testFormat: generic/{0}/1 testFormat: generic/{0}/1
targets: targets:
- test: 3.11
- test: 3.12 - test: 3.12
- test: 3.13 - test: 3.13
- test: 3.14
- stage: Incidental_Windows - stage: Incidental_Windows
displayName: Incidental Windows displayName: Incidental Windows
dependsOn: [] dependsOn: []
@ -198,15 +212,10 @@ stages:
test: 2022/psrp/http test: 2022/psrp/http
- name: 2022 SSH Key - name: 2022 SSH Key
test: 2022/ssh/key test: 2022/ssh/key
- stage: Incidental - name: 2025 PSRP HTTP
dependsOn: [] test: 2025/psrp/http
jobs: - name: 2025 SSH Key
- template: templates/matrix.yml test: 2025/ssh/key
parameters:
testFormat: i/{0}/1
targets:
- name: IOS Python
test: ios/csr1000v/
- stage: Summary - stage: Summary
condition: succeededOrFailed() condition: succeededOrFailed()
dependsOn: dependsOn:
@ -218,6 +227,5 @@ stages:
- Galaxy - Galaxy
- Generic - Generic
- Incidental_Windows - Incidental_Windows
- Incidental
jobs: jobs:
- template: templates/coverage.yml - template: templates/coverage.yml

@ -13,6 +13,9 @@ else
target="shippable/generic/" target="shippable/generic/"
fi fi
stage="${S:-prod}"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \ ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--remote-terminate always --remote-stage "${stage}" \
--docker default --python "${python}" --docker default --python "${python}"

@ -1,40 +0,0 @@
#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
platform="${args[0]}"
version="${args[1]}"
python_version="${args[2]}"
target="shippable/${platform}/incidental/"
stage="${S:-prod}"
provider="${P:-default}"
# python versions to test in order
# all versions run full tests
IFS=' ' read -r -a python_versions <<< \
"$(PYTHONPATH="${PWD}/test/lib" python -c 'from ansible_test._internal import constants; print(" ".join(constants.CONTROLLER_PYTHON_VERSIONS))')"
if [ "${python_version}" ]; then
# limit tests to a single python version
python_versions=("${python_version}")
fi
for python_version in "${python_versions[@]}"; do
# terminate remote instances on the final python version tested
if [ "${python_version}" = "${python_versions[-1]}" ]; then
terminate="always"
else
terminate="never"
fi
# shellcheck disable=SC2086
ansible-test network-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--platform "${platform}/${version}" \
--docker default --python "${python_version}" \
--remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}"
done

@ -0,0 +1,6 @@
[tool.pip-tools]
allow-unsafe = true # weird outdated default
annotation-style = "line" # put the source tracking comments inline
generate-hashes = false # pip bug https://github.com/pypa/pip/issues/9243
resolver = "backtracking" # modern depresolver
strip-extras = true # so that output files are true pip constraints

@ -0,0 +1,18 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --annotation-style=line --output-file=codecov.txt --strip-extras codecov.in
#
certifi==2025.8.3 # via requests, sentry-sdk
charset-normalizer==3.4.3 # via requests
click==8.2.1 # via codecov-cli
codecov-cli==11.2.3 # via -r codecov.in
idna==3.10 # via requests
ijson==3.4.0 # via codecov-cli
pyyaml==6.0.2 # via codecov-cli
requests==2.32.5 # via responses
responses==0.21.0 # via codecov-cli
sentry-sdk==2.38.0 # via codecov-cli
test-results-parser==0.5.4 # via codecov-cli
urllib3==2.5.0 # via requests, responses, sentry-sdk

@ -9,11 +9,15 @@ from __future__ import annotations
import argparse import argparse
import dataclasses import dataclasses
import pathlib import pathlib
import shutil import shlex
import subprocess import subprocess
import tempfile import tempfile
import typing as t import typing as t
import urllib.request import venv
SCRIPTS_DIR = pathlib.Path(__file__).parent.resolve()
DEPS_DIR = SCRIPTS_DIR / 'dependencies'
@dataclasses.dataclass(frozen=True) @dataclasses.dataclass(frozen=True)
@ -43,6 +47,49 @@ def parse_args() -> Args:
return Args(**kwargs) return Args(**kwargs)
def run(
*args: str | pathlib.Path,
dry_run: bool = False,
) -> None:
"""
Log and run given command.
The command is not actually executed if ``dry_run`` is truthy.
"""
cmd = [str(arg) for arg in args]
dry_prefix = '[would run] ' if dry_run else ''
print(f'==> {dry_prefix}{shlex.join(cmd)}', flush=True)
if not dry_run:
subprocess.run(cmd, check=True)
def install_codecov(dest: pathlib.Path, dry_run: bool = False) -> pathlib.Path:
"""Populate a transitively pinned venv with ``codecov-cli``."""
requirement_file = DEPS_DIR / 'codecov.in'
constraint_file = requirement_file.with_suffix('.txt')
venv_dir = dest / 'venv'
python_bin = venv_dir / 'bin' / 'python'
codecov_bin = venv_dir / 'bin' / 'codecovcli'
venv.create(venv_dir, with_pip=True)
run(
python_bin,
'-m',
'pip',
'install',
f'--constraint={constraint_file!s}',
f'--requirement={requirement_file!s}',
'--disable-pip-version-check',
dry_run=dry_run,
)
return codecov_bin
def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]: def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
processed = [] processed = []
for file in directory.joinpath('reports').glob('coverage*.xml'): for file in directory.joinpath('reports').glob('coverage*.xml'):
@ -57,45 +104,67 @@ def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
return tuple(processed) return tuple(processed)
def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], dry_run: bool = False) -> None: def upload_files(codecov_bin: pathlib.Path, config_file: pathlib.Path, files: t.Tuple[CoverageFile, ...], dry_run: bool = False) -> None:
for file in files: for file in files:
cmd = [ cmd = [
str(codecov_bin), codecov_bin,
'--name', file.name, '--disable-telem',
'--file', str(file.path), '--codecov-yml-path',
config_file,
'upload-process',
'--disable-search',
'--disable-file-fixes',
'--plugin',
'noop',
'--name',
file.name,
'--file',
file.path,
] ]
for flag in file.flags: for flag in file.flags:
cmd.extend(['--flags', flag]) cmd.extend(['--flag', flag])
if dry_run: if dry_run:
print(f'DRY-RUN: Would run command: {cmd}') cmd.append('--dry-run')
continue
subprocess.run(cmd, check=True) run(*cmd)
def download_file(url: str, dest: pathlib.Path, flags: int, dry_run: bool = False) -> None: def report_upload_completion(
if dry_run: codecov_bin: pathlib.Path,
print(f'DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}') config_file: pathlib.Path,
return dry_run: bool = False,
) -> None:
with urllib.request.urlopen(url) as resp: """Notify Codecov backend that all reports we wanted are in."""
with dest.open('w+b') as f: cmd = [
# Read data in chunks rather than all at once codecov_bin,
shutil.copyfileobj(resp, f, 64 * 1024) '--disable-telem',
f'--codecov-yml-path={config_file}',
'send-notifications',
]
dest.chmod(flags) run(*cmd, dry_run=dry_run)
def main(): def main() -> None:
args = parse_args() args = parse_args()
url = 'https://ci-files.testing.ansible.com/codecov/linux/codecov'
with tempfile.TemporaryDirectory(prefix='codecov-') as tmpdir:
codecov_bin = pathlib.Path(tmpdir) / 'codecov'
download_file(url, codecov_bin, 0o755, args.dry_run)
with tempfile.TemporaryDirectory(prefix='codecov-') as tmpdir:
config_file = pathlib.Path(tmpdir) / 'config.yml'
# Refs:
# * https://docs.codecov.com/docs/codecovyml-reference#codecovnotifymanual_trigger
# * https://docs.codecov.com/docs/notifications#preventing-notifications-until-youre-ready-to-send-notifications
config_file.write_text('codecov:\n notify:\n manual_trigger: true')
codecov_bin = install_codecov(
pathlib.Path(tmpdir),
dry_run=args.dry_run,
)
files = process_files(args.path) files = process_files(args.path)
upload_files(codecov_bin, files, args.dry_run) upload_files(codecov_bin, config_file, files, args.dry_run)
# Ref: https://docs.codecov.com/docs/cli-options#send-notifications
report_upload_completion(codecov_bin, config_file, args.dry_run)
if __name__ == '__main__': if __name__ == '__main__':

@ -12,6 +12,6 @@ if ! ansible-test --help >/dev/null 2>&1; then
pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
fi fi
# Generate stubs using docker (if supported) otherwise fall back to using a virtual environment instead. # Generate stubs using docker.
# The use of docker is required when Powershell code is present, but Ansible 2.12 was the first version to support --docker with coverage. # The use of docker is mandatory when Powershell code is present.
ansible-test coverage xml --group-by command --stub --docker --color -v || ansible-test coverage xml --group-by command --stub --venv --color -v ansible-test coverage xml --group-by command --stub --docker --color -v

@ -7,6 +7,7 @@ jobs:
- job: Coverage - job: Coverage
displayName: Code Coverage displayName: Code Coverage
container: $[ variables.defaultContainer ] container: $[ variables.defaultContainer ]
timeoutInMinutes: 10
workspace: workspace:
clean: all clean: all
steps: steps:

@ -12,6 +12,7 @@ jobs:
- job: test_${{ replace(replace(replace(replace(job.test, '/', '_'), '.', '_'), '-', '_'), '@', '_') }} - job: test_${{ replace(replace(replace(replace(job.test, '/', '_'), '.', '_'), '-', '_'), '@', '_') }}
displayName: ${{ job.name }} displayName: ${{ job.name }}
container: $[ variables.defaultContainer ] container: $[ variables.defaultContainer ]
timeoutInMinutes: 65
workspace: workspace:
clean: all clean: all
steps: steps:

@ -0,0 +1,55 @@
---
description: Review an Ansible PR following the project's standardized process from CLAUDE.md
argument-hint: <pr_number>
allowed-tools: [TodoWrite, Bash(gh pr view:*), Bash(gh pr diff:*), Bash(gh pr checkout:*), Bash(gh pr checks:*), Read, Grep, Glob, Search]
---
PR Review Command
=================
Review an Ansible PR following the project's standardized process from `CLAUDE.md`.
Usage
-----
```bash
/review <pr_number>
```
Arguments
---------
- `pr_number` (required): The GitHub PR number to review
Implementation
--------------
This command implements the PR Review Guidelines documented in the `PR Review Guidelines` section of CLAUDE.md.
Review Process Steps
--------------------
The command follows these numbered steps from CLAUDE.md:
1. **Create TodoWrite list** for systematic review tracking
2. **Get PR details**: `gh pr view <number>` to understand scope, motivation and the desired outcome
3. **Get PR diff**: `gh pr diff <number>` to see all changes
4. **Check required components FIRST**:
- Verify changelog fragment exists in `changelogs/fragments/`
- Verify changelog uses correct section (check `changelogs/config.yaml`)
- Verify tests exist and specifically cover the changed code paths
- Unit tests should be pytest style, and functional rather than tightly coupled to mocking
- Integration tests required for almost all plugin changes
5. **Checkout PR branch**: `gh pr checkout <number>` to examine code holistically
6. **Review existing feedback**: `gh pr view <number> --comments` for all comments and previous reviews
7. **Verify all issues addressed**: Ensure bot failures, reviewer requests, and discussion points are resolved
8. **Call out unresolved feedback**: Explicitly mention any discussions/requests that remain unaddressed
Critical Review Elements
------------------------
- **Licensing**: Verify GPLv3/BSD-2-Clause compatibility for any new dependencies
- **Test scope**: Tests must exercise actual changed code, not just add random coverage
- **Changelog validation**: Fragment structure follows sections defined in `changelogs/config.yaml`
Each step is tracked in TodoWrite for visibility and systematic completion. A review round should not exceed 20 feedback items.

@ -2,3 +2,5 @@
# Bulk PowerShell sanity fixes # Bulk PowerShell sanity fixes
6def4a3180fe03981ba64c6d8db28fed3bb39c0c 6def4a3180fe03981ba64c6d8db28fed3bb39c0c
716631189cb5a3f66b3add98f39e64e98bc17bf7 716631189cb5a3f66b3add98f39e64e98bc17bf7
# Bulk update of strings from triple single quotes to triple double quotes
a0495fc31497798a7a833ba7406a9729e1528dd8

@ -47,23 +47,7 @@ body:
- type: dropdown - type: dropdown
attributes: attributes:
label: Issue Type label: Issue Type
description: > description: This is a marker for our automatic bot. Do not change it.
Please select the single available option in the drop-down.
<details>
<summary>
<em>Why?</em>
</summary>
We would do it by ourselves but unfortunately, the current
edition of GitHub Issue Forms Alpha does not support this yet 🤷
_We will make it easier in the future, once GitHub
supports dropdown defaults. Promise!_
</details>
# FIXME: Once GitHub allows defining the default choice, update this
options: options:
- Bug Report - Bug Report
validations: validations:
@ -121,7 +105,8 @@ body:
label: Configuration label: Configuration
description: >- description: >-
Paste verbatim output from `ansible-config dump --only-changed -t all` below, under the prompt line. Paste verbatim output from `ansible-config dump --only-changed -t all` below, under the prompt line.
(if using a version older than ansible-core 2.12 you should omit the '-t all') Remember to redact secret values. You can easily filter Galaxy server secrets using grep,
for example `ansible-config dump --only-changed -t all | grep -Ev 'token|password|client_secret'`.
Please don't wrap it with triple backticks — your Please don't wrap it with triple backticks — your
whole input will be turned into a code snippet automatically. whole input will be turned into a code snippet automatically.
render: console render: console
@ -152,7 +137,7 @@ body:
attributes: attributes:
label: Steps to Reproduce label: Steps to Reproduce
description: | description: |
Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also pased any playbooks, configs and commands you used. Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also provide any playbooks, configs and commands you used.
**HINT:** You can paste https://gist.github.com links for larger files. **HINT:** You can paste https://gist.github.com links for larger files.
value: | value: |

@ -16,10 +16,10 @@ contact_links:
url: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser url: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser
about: ❤ Be nice to other members of the community. ☮ Behave. about: ❤ Be nice to other members of the community. ☮ Behave.
- name: 💬 Talk to the community - name: 💬 Talk to the community
url: https://docs.ansible.com/ansible/devel/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#mailing-list-information url: https://docs.ansible.com/ansible/devel/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#forum
about: Please ask and answer usage questions here about: Please ask and answer usage questions here
- name: ⚡ Working groups - name: ⚡ Working groups
url: https://github.com/ansible/community/wiki url: https://forum.ansible.com/g?utm_medium=github&utm_source=issue_template_chooser
about: Interested in improving a specific area? Become a part of a working group! about: Interested in improving a specific area? Become a part of a working group!
- name: 💼 For Enterprise - name: 💼 For Enterprise
url: https://www.ansible.com/products/engine?utm_medium=github&utm_source=issue_template_chooser url: https://www.ansible.com/products/engine?utm_medium=github&utm_source=issue_template_chooser

@ -84,20 +84,7 @@ body:
- type: dropdown - type: dropdown
attributes: attributes:
label: Issue Type label: Issue Type
description: > description: This is a marker for our automatic bot. Do not change it.
Please select the single available option in the drop-down.
<details>
<summary>
<em>Why?</em>
</summary>
_We will make it easier in the future, once GitHub
supports dropdown defaults. Promise!_
</details>
# FIXME: Once GitHub allows defining the default choice, update this
options: options:
- Documentation Report - Documentation Report
validations: validations:
@ -143,6 +130,8 @@ body:
label: Configuration label: Configuration
description: >- description: >-
Paste verbatim output from `ansible-config dump --only-changed -t all` below, under the prompt line. Paste verbatim output from `ansible-config dump --only-changed -t all` below, under the prompt line.
Remember to redact secret values. You can easily filter Galaxy server secrets using grep,
for example `ansible-config dump --only-changed -t all | grep -Ev 'token|password|client_secret'`.
(if using a version older than ansible-core 2.12 you should omit the '-t all') (if using a version older than ansible-core 2.12 you should omit the '-t all')
Please don't wrap it with triple backticks — your Please don't wrap it with triple backticks — your
whole input will be turned into a code snippet automatically. whole input will be turned into a code snippet automatically.

@ -101,23 +101,7 @@ body:
- type: dropdown - type: dropdown
attributes: attributes:
label: Issue Type label: Issue Type
description: > description: This is a marker for our automatic bot. Do not change it.
Please select the single available option in the drop-down.
<details>
<summary>
<em>Why?</em>
</summary>
We would do it by ourselves but unfortunately, the current
edition of GitHub Issue Forms Alpha does not support this yet 🤷
_We will make it easier in the future, once GitHub
supports dropdown defaults. Promise!_
</details>
# FIXME: Once GitHub allows defining the default choice, update this
options: options:
- Feature Idea - Feature Idea
validations: validations:

@ -0,0 +1,10 @@
---
name: Internal Issue
about: Free-form issue creation for core maintainer use only.
title: ''
labels: [core-internal]
assignees: ''
---
@ansibot bot_skip

@ -0,0 +1,42 @@
name: Pre-Release Bug Report
description: File a bug report against a pre-release version
labels:
- bug
- pre_release
assignees:
- nitzmahone
- mattclay
body:
- type: markdown
attributes:
value: |
## Bug Report
- type: textarea
attributes:
label: Ansible Version
description: Paste the full output from `ansible --version` below.
render: console
placeholder: $ ansible --version
validations:
required: true
- type: textarea
attributes:
label: Summary
description: Describe the issue with any relevant steps to reproduce.
validations:
required: true
- type: dropdown
attributes:
label: <!-- Bot instructions (ignore this) -->
options:
- |
<!--
### Component Name
bin/ansible
### Issue Type
Bug Report
### Configuration
### OS / Environment
-->
validations:
required: true

@ -2,19 +2,8 @@
<!--- Describe the change below, including rationale and design decisions --> <!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> <!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE ##### ISSUE TYPE
- Bugfix Pull Request - Bugfix Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

@ -2,18 +2,8 @@
<!--- Describe the change below, including rationale --> <!--- Describe the change below, including rationale -->
<!--- HINT: Include "Closes #nnn" if you are fixing an existing issue --> <!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE ##### ISSUE TYPE
- Docs Pull Request - Docs Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

@ -2,18 +2,8 @@
<!--- Describe the change below, including rationale and design decisions --> <!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Resolves #nnn" if you are fixing an existing issue --> <!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE ##### ISSUE TYPE
- Feature Pull Request - Feature Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

@ -2,19 +2,8 @@
<!--- Describe the change below, including rationale and design decisions --> <!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Closes #nnn" if you are fixing an existing issue --> <!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE ##### ISSUE TYPE
- Test Pull Request - Test Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

@ -2,7 +2,7 @@
<!--- Describe the change below, including rationale and design decisions --> <!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> <!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE ##### ISSUE TYPE
@ -12,14 +12,3 @@
- Docs Pull Request - Docs Pull Request
- Feature Pull Request - Feature Pull Request
- Test Pull Request - Test Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

@ -1,3 +1,5 @@
2.20.0 Good Times Bad Times
2.19.0 What Is and What Should Never Be
2.18.0 Fool in the Rain 2.18.0 Fool in the Rain
2.17.0 Gallows Pole 2.17.0 Gallows Pole
2.16.0 All My Love 2.16.0 All My Love

5
.gitignore vendored

@ -97,6 +97,9 @@ Vagrantfile
# vendored lib dir # vendored lib dir
lib/ansible/_vendor/* lib/ansible/_vendor/*
!lib/ansible/_vendor/__init__.py !lib/ansible/_vendor/__init__.py
# PowerShell signed hashlist
lib/ansible/config/powershell_signatures.psd1
*.authenticode
# test stuff # test stuff
/test/integration/cloud-config-*.* /test/integration/cloud-config-*.*
!/test/integration/cloud-config-*.*.template !/test/integration/cloud-config-*.*.template
@ -124,3 +127,5 @@ test/units/.coverage.*
/SYMLINK_CACHE.json /SYMLINK_CACHE.json
changelogs/.plugin-cache.yaml changelogs/.plugin-cache.yaml
.ansible-test-timeout.json .ansible-test-timeout.json
# Agents
CLAUDE.local.md

@ -0,0 +1,321 @@
# AGENTS.md
This file provides guidance to Claude Code (claude.ai/code) and other compatible agentic tools when working with code in this repository.
**Note:** This file is for AI assistant use only. For human developers, see the [Ansible Developer Guide](https://docs.ansible.com/ansible-core/devel/dev_guide/index.html).
## ⚠️ IMPORTANT: Always Start Here
**BEFORE starting any PR review or development task:**
1. **Read this file first** - Don't work from memory or assumptions
2. **Use TodoWrite** to create a task list and track progress systematically
3. **Follow the numbered steps** in the relevant process sections
4. **Reference Quick Reference** for correct commands and patterns
## ⚠️ CRITICAL: Licensing Requirements
**NEVER suggest, recommend, or approve code that violates these requirements:**
- **ansible-core**: All code must be **GPLv3 compatible**
- **lib/ansible/module_utils/**: Defaults to **BSD-2-Clause** (more permissive)
- **External dependencies**: Only recommend libraries compatible with these licenses
- **PR reviews**: Always verify any new dependencies or suggested libraries are license-compatible
- **When in doubt**: Ask about licensing compatibility rather than assuming
**This is non-negotiable** - licensing violations can create serious legal issues for the project.
## Quick Reference
Most commonly used commands and patterns:
```bash
# Testing
ansible-test sanity -v --docker default # Run all sanity tests
ansible-test sanity -v --docker default --test <test> # Run specific sanity test
ansible-test units -v --docker default # Run unit tests
ansible-test integration -v --docker ubuntu2404 # Run integration tests
# PR Review and CI
gh pr view <number> # Get PR details
gh pr view <number> --comments # Check for ansibot CI failures
gh pr checks <number> # Get Azure Pipelines URLs
gh pr checkout <number> # Switch to PR branch
gh pr diff <number> # See all changes
```
**Container Selection:**
- Sanity/Unit tests: `--docker default`
- Integration tests: `--docker ubuntu2204`, `--docker ubuntu2404`, etc. (NOT default/base)
**Critical Reminders:**
- **Licensing**: See [Licensing Requirements](#-critical-licensing-requirements) - GPLv3/BSD-2-Clause only
## Development Environment Setup
Ansible development typically uses an editable install after forking and cloning:
```bash
# After forking and cloning the repository
pip install -e .
```
**Note:** ansible-core and all CLIs (including ansible-test) require a POSIX OS. On Windows, use WSL (Windows Subsystem for Linux).
## Testing and CI
### Basic Testing Commands
```bash
# Run sanity tests - these are linting/static analysis (pylint, mypy, pep8, etc.)
ansible-test sanity -v --docker default
# List available sanity tests
ansible-test sanity --list-tests
# Run specific sanity tests
ansible-test sanity -v --docker default --test pep8 --test pylint
# Run sanity on specific files (paths relative to repo root)
ansible-test sanity -v --docker default lib/ansible/modules/command.py
# Run unit tests (recommended with Docker)
ansible-test units -v --docker default
# Run specific unit test (paths relative to repo root, targets in test/units/)
ansible-test units -v --docker default test/units/modules/test_command.py
# Run integration tests (choose appropriate container - NOT base/default)
ansible-test integration -v --docker ubuntu2404
# Run specific integration target (directory name in test/integration/targets/)
ansible-test integration -v --docker ubuntu2404 setup_remote_tmp_dir
# Run with coverage
ansible-test units -v --docker default --coverage
# Alternative: use --venv if Docker/Podman unavailable (less reliable for units/integration)
ansible-test sanity -v --venv
```
Available Docker containers for testing can be found in `./test/lib/ansible_test/_data/completion/docker.txt`.
The `base` and `default` containers are for sanity/unit tests only. For integration tests, use distro-specific
containers, depending on the modules being tested.
**Test isolation options:**
- `--docker` (supports Docker or Podman) - preferred for reliable, isolated testing
- `--venv` - fallback when containers unavailable, but unit tests may be unreliable due to host environment differences
### Helping Developers with CI Failures
When developers submit PRs and encounter CI failures, use these approaches to help diagnose and resolve issues:
**1. Check for ansibot comments:**
```bash
# Get all PR comments to find ansibot CI failure reports
gh pr view <number> --comments
```
Look for comments from `ansibot` that contain:
- Test failure details with specific error messages
- File paths and line numbers for failures
- Links to sanity test documentation (e.g., `[explain](https://docs.ansible.com/...`)
**2. Get CI check status and URLs:**
```bash
# See all CI check results with Azure Pipelines URLs
gh pr checks <number>
```
This shows:
- Overall CI status (pass/fail) with timing
- Direct links to Azure DevOps build results
- Individual job results (Sanity Test 1/2, Docker tests, Units, etc.)
**3. Common CI failure patterns:**
- **Sanity failures**: Usually have specific fixes (trailing whitespace, import errors, etc.)
- **Integration test failures**: May require platform-specific containers or test adjustments
- **Unit test failures**: Often indicate actual code issues that need debugging
**4. CI failure analysis workflow:**
1. Check ansibot comments first for immediate error details
2. Use `gh pr checks <number>` to get Azure Pipelines URLs for detailed logs
3. Focus on failed jobs (marked as `fail`) and examine their specific error output
4. For sanity test failures, the error messages usually indicate exactly what needs to be fixed
5. For test failures, run the same tests locally using `ansible-test` to reproduce and debug
## PR Review Guidelines
### PR Review Checklist
Use this checklist for EVERY PR review:
```text
□ Created TodoWrite list for review steps
□ Step 1: Get PR details with gh pr view <number>
□ Step 2: Get PR diff with gh pr diff <number>
□ Step 3: Check required components (changelog, tests)
□ Step 4: Checkout PR branch with gh pr checkout <number>
□ Step 5: Review existing feedback with gh pr view <number> --comments
□ Step 6: Verify all issues addressed
□ Step 7: Call out any unresolved feedback
□ Mark each TodoWrite item as completed when done
```
When assisting with PR reviews, verify:
### Required Components
- Changelog fragment exists in `changelogs/fragments/`
- Appropriate tests are included and cover the changed code
- Unit tests should be pytest style, and functional rather than tightly coupled to mocking
- Integration tests required for almost all plugin changes (tests the public API)
- Tests should exercise the actual changed code, not just add random coverage
### Review Process
Follow these steps in order for thorough PR reviews:
1. **Get PR details**: Use `gh pr view <number>` to understand the PR scope and description
2. **Get PR diff**: Use `gh pr diff <number>` to see all changes
3. **Check required components FIRST**:
- Verify changelog fragment exists and uses correct section (check `changelogs/config.yaml` for valid sections)
- Verify tests exist and specifically cover the changed code paths
4. **Checkout PR branch**: Use `gh pr checkout <number>` to examine code holistically with changes applied
5. **Review existing feedback**: Use `gh pr view <number> --comments` to see all comments and previous review feedback
6. **Verify all issues addressed**: Ensure all bot failures, reviewer requests, and discussion points are resolved
7. **Call out any unresolved review feedback**: Explicitly mention any discussions or requests that remain unaddressed
### Common Review Issues to Check
- **Changelog section errors**: Verify changelog uses valid section from `changelogs/config.yaml`. Fragment structure follows sections defined there.
- **Test scope**: Ensure tests exercise the actual changed code, not just add random coverage.
Integration tests required for almost all plugin changes (tests the public API).
Tests should be functional rather than tightly coupled to mocking.
### Review Task Management
- Use TodoWrite tool to track review steps for complex PRs
- Mark tasks as in_progress when actively working on them
- Complete tasks immediately after finishing each step
- This provides visibility to users about review progress
### Review Tools
- `gh pr view <number>` - Get PR details and description
- `gh pr view <number> --comments` - See all comments and review feedback
- `gh pr diff <number>` - Get complete diff of changes
- `gh pr checkout <number>` - Switch to PR branch for holistic examination
- `Read` tool - Examine specific changed files in detail
- `Grep` tool - Search for related code patterns or test coverage (uses ripgrep/rg)
## Development Guidelines
### Code Style Notes
- Line limit is 160 characters (not 80)
- E402 (module level import not at top) is ignored
- In `lib/ansible/modules/`, imports must come after DOCUMENTATION, EXAMPLES, and RETURN definitions
- Don't add obvious comments about code
- Use native type hints with `from __future__ import annotations` (converts to strings at runtime)
- Don't document module parameters in docstrings - migrate to type hints instead
- **No trailing whitespace**: Always clean up trailing spaces on lines, especially when editing existing files
### Python Version Support
- Controller code: support range defined in `pyproject.toml`
- Modules/module_utils: minimum version in `lib/ansible/module_utils/basic.py` (`_PY_MIN`) up to max from `pyproject.toml`
- Modules support a wider Python version range than controller code
### Dependencies and Imports
- Prefer Python stdlib over external dependencies
- Use existing code from within the Ansible project
- `lib/ansible/modules/` can only import from `lib/ansible/module_utils/` (modules are packaged for remote execution)
- `lib/ansible/module_utils/` cannot import from outside itself
## Documentation Standards
### Module and Plugin Documentation
- Modules and plugins require DOCUMENTATION, EXAMPLES, and RETURN blocks as static YAML string variables
- These blocks cannot be dynamically generated - they are parsed via AST/token parsing
- Alternative: "sidecar" documentation as `.yml` files with same stem name adjacent to plugin files
- All modules should have a `main()` function and `if __name__ == '__main__':` block
- Use `version_added` fields in documentation following existing version format patterns
### Changelog Requirements
- Changes require entries in `changelogs/fragments/` as YAML files
- Create a new fragment file per PR (never reuse existing fragments to avoid merge conflicts)
- Fragment structure follows sections defined in `changelogs/config.yaml` under the `sections` key
- Naming: `{issue_number}-{short-description}.yml` or `{component}-{description}.yml` if no issue
- Format: `- {component} - {description} ({optional URL to GH issue})`
- Content supports Sphinx markup (use double backticks for code references)
## Repository Management
### Plugin Development
- New plugins should go into collections, not ansible-core
- ansible-core rarely accepts new plugins; core team makes these decisions
### Branch and Release Management
- All PRs target the `devel` branch
- Use GitHub templates when creating issues/PRs (`.github/ISSUE_TEMPLATE/` and `.github/PULL_REQUEST_TEMPLATE/`)
- For issues: fill out the `component` field with project root relative file path
- For PRs: adjust the issue type in the template as listed in `.github/PULL_REQUEST_TEMPLATE/PULL_REQUEST_TEMPLATE.md`
- Validate issues are fixed in `devel` before reporting against stable releases
- Bug fixes: backported to latest stable only
- Critical bug fixes: backported to latest and previous stable
- Security issues: contact security@ansible.com privately, not via GitHub
### Backwards Compatibility
- Backwards compatibility is prioritized over most other concerns
- Deprecation cycle: 4 releases (deprecation + 2 releases + removal)
- Use `Display.deprecated` or `AnsibleModule.deprecate` with version from `lib/ansible/release.py` plus 3
- Example: deprecating in 2.19 means removal in 2.22
## Code Structure Reference
### Core Structure
- `lib/ansible/` - Main Ansible library code
- `cli/` - Command-line interface implementations (ansible, ansible-playbook, etc.)
- `executor/` - Task execution engine and strategies (includes PowerShell support in `powershell/`)
- `inventory/` - Inventory management and parsing
- `modules/` - Core modules (built-in automation modules)
- `module_utils/` - Shared utilities for modules (includes C# in `csharp/` and PowerShell in `powershell/`)
- `plugins/` - Plugin framework (filters, tests, lookups, etc.)
- `vars/` - Variable management
- `config/` - Configuration handling
- `collections/` - Ansible Collections framework
### Key Components
- **CLI Layer**: Entry points in `lib/ansible/cli/` handle command parsing and dispatch
- **Executor**: `lib/ansible/executor/` contains the core execution engine that runs tasks and plays
- **Module System**: Modules in `lib/ansible/modules/` are the units of work; they're executed remotely
- **Plugin Architecture**: `lib/ansible/plugins/` provides extensibility through filters, tests, lookups, etc.
- **Inventory**: `lib/ansible/inventory/` manages host and group definitions
- **Collections**: Modern packaging format for distributing Ansible content
### Testing Infrastructure
- `test/units/` - Unit tests mirroring the lib structure
- `test/integration/` - Integration tests organized by target (named after plugin/functionality being tested)
- Some targets have `context/controller` or `context/target` in their `aliases` file when not easily inferable
- Only modules run on target hosts; all other plugins execute locally in the ansible process
- `test/lib/` - Test utilities and frameworks
- `ansible-test` - Unified testing tool for all test types
For CI failure debugging, see [Helping Developers with CI Failures](#helping-developers-with-ci-failures).

@ -0,0 +1,3 @@
- @AGENTS.md
- @~/.claude/ansible.md
- @CLAUDE.local.md

@ -1,2 +1,2 @@
ancestor: 2.17.0 ancestor: 2.20.0
releases: {} releases: {}

@ -1,3 +0,0 @@
---
bugfixes:
- vault - handle vault password file value when it is directory (https://github.com/ansible/ansible/issues/42960).

@ -1,3 +0,0 @@
---
bugfixes:
- apt - report changed=True when some packages are being removed (https://github.com/ansible/ansible/issues/46314).

@ -1,2 +0,0 @@
bugfixes:
- atomic_move - fix using the setgid bit on the parent directory when creating files (https://github.com/ansible/ansible/issues/46742, https://github.com/ansible/ansible/issues/67177).

@ -1,2 +0,0 @@
minor_changes:
- loop_control - add a break_when option to to break out of a task loop early based on Jinja2 expressions (https://github.com/ansible/ansible/issues/83442).

@ -1,2 +0,0 @@
bugfixes:
- get_url - Verify checksum using tmpsrc, not dest (https://github.com/ansible/ansible/pull/64092)

@ -1,3 +0,0 @@
---
bugfixes:
- git - check if git version is available or not before using it for comparison (https://github.com/ansible/ansible/issues/72321).

@ -1,3 +0,0 @@
minor_changes:
- Add ``uid_min``, ``uid_max`` to the user plugin to overwrite the defaults provided by the ``/etc/login.defs`` file (https://github.com/ansible/ansible/pull/81770).
- Add ``gid_min``, ``gid_max`` to the group plugin to overwrite the defaults provided by the ``/etc/login.defs`` file (https://github.com/ansible/ansible/pull/81770).

@ -1,2 +0,0 @@
bugfixes:
- addressed issue of trailing text been ignored, non-ASCII characters are parsed, enhance white space handling and fixed overly permissive issue of human_to_bytes filter(https://github.com/ansible/ansible/issues/82075)

@ -1,2 +0,0 @@
bugfixes:
- Fix handlers not being executed in lockstep using the linear strategy in some cases (https://github.com/ansible/ansible/issues/82307)

@ -1,2 +0,0 @@
bugfixes:
- fixed the issue of creating user directory using tilde(~) always reported "changed".(https://github.com/ansible/ansible/issues/82490)

@ -1,2 +0,0 @@
bugfixes:
- shell plugin - properly quote all needed components of shell commands (https://github.com/ansible/ansible/issues/82535)

@ -1,2 +0,0 @@
minor_changes:
- "ansible-doc - show examples in role entrypoint argument specs (https://github.com/ansible/ansible/pull/82671)."

@ -1,2 +0,0 @@
bugfixes:
- support the countme option when using yum_repository

@ -1,4 +0,0 @@
bugfixes:
- >-
fetch - add error message when using ``dest`` with a trailing slash that becomes a local directory -
https://github.com/ansible/ansible/issues/82878

@ -1,5 +0,0 @@
---
removed_features:
- paramiko_ssh - removed deprecated ssh_extra_args from the paramiko_ssh connection plugin (https://github.com/ansible/ansible/issues/82941).
- paramiko_ssh - removed deprecated ssh_common_args from the paramiko_ssh connection plugin (https://github.com/ansible/ansible/issues/82940).
- paramiko_ssh - removed deprecated ssh_args from the paramiko_ssh connection plugin (https://github.com/ansible/ansible/issues/82939).

@ -1,3 +0,0 @@
---
removed_features:
- play_context - remove deprecated PlayContext.verbosity property (https://github.com/ansible/ansible/issues/82945).

@ -1,3 +0,0 @@
---
removed_features:
- loader - remove deprecated non-inclusive words (https://github.com/ansible/ansible/issues/82947).

@ -1,2 +0,0 @@
bugfixes:
- "linear strategy: fix handlers included via ``include_tasks`` handler to be executed in lockstep (https://github.com/ansible/ansible/issues/83019)"

@ -1,3 +0,0 @@
---
bugfixes:
- lookup - Fixed examples of csv lookup plugin (https://github.com/ansible/ansible/issues/83031).

@ -1,2 +0,0 @@
bugfixes:
- "ansible-doc - format top-level descriptions with multiple paragraphs as multiple paragraphs, instead of concatenating them (https://github.com/ansible/ansible/pull/83155)."

@ -1,2 +0,0 @@
bugfixes:
- copy - mtime/atime not updated. Fix now update mtime/atime(https://github.com/ansible/ansible/issues/83013)

@ -1,2 +0,0 @@
bugfixes:
- Fix for ``meta`` tasks breaking host/fork affinity with ``host_pinned`` strategy (https://github.com/ansible/ansible/issues/83294)

@ -1,3 +0,0 @@
---
bugfixes:
- fixed unit test test_borken_cowsay to address mock not been properly applied when existing unix system already have cowsay installed.

@ -1,3 +0,0 @@
---
bugfixes:
- facts - add facts about x86_64 flags to detect microarchitecture (https://github.com/ansible/ansible/issues/83331).

@ -1,2 +0,0 @@
bugfixes:
- dnf, dnf5 - fix for installing a set of packages by specifying them using a wildcard character (https://github.com/ansible/ansible/issues/83373)

@ -1,2 +0,0 @@
bugfixes:
- Fix rapid memory usage growth when notifying handlers using the ``listen`` keyword (https://github.com/ansible/ansible/issues/83392)

@ -1,2 +0,0 @@
bugfixes:
- dnf - fix an issue where two packages of the same ``evr`` but different arch failed to install (https://github.com/ansible/ansible/issues/83406)

@ -1,2 +0,0 @@
bugfixes:
- "``end_host`` - fix incorrect return code when executing ``end_host`` in the ``rescue`` section (https://github.com/ansible/ansible/issues/83447)"

@ -1,2 +0,0 @@
bugfixes:
- service_facts - don't crash if OpenBSD rcctl variable contains '=' character (https://github.com/ansible/ansible/issues/83457)

@ -1,2 +0,0 @@
minor_changes:
- "ansible-test - update HTTP test container to 3.2.0 (https://github.com/ansible/ansible/pull/83469)."

@ -1,6 +0,0 @@
---
bugfixes:
- facts - `support_discard` now returns `0` if either `discard_granularity`
or `discard_max_hw_bytes` is zero; otherwise it returns the value of
`discard_granularity`, as before
(https://github.com/ansible/ansible/pull/83480).

@ -1,2 +0,0 @@
bugfixes:
- Fix a traceback when an environment variable contains certain special characters (https://github.com/ansible/ansible/issues/83498)

@ -1,2 +0,0 @@
minor_changes:
- Add a new mount_facts module to support gathering information about mounts that are excluded by default fact gathering.

@ -1,2 +0,0 @@
minor_changes:
- "validate-modules sanity test - reject option/aliases names that are identical up to casing but belong to different options (https://github.com/ansible/ansible/pull/83530)."

@ -1,2 +0,0 @@
bugfixes:
- distro package - update the distro package version from 1.8.0 to 1.9.0 (https://github.com/ansible/ansible/issues/82935)

@ -1,2 +0,0 @@
minor_changes:
- distribution.py - Added SL-Micro in Suse OS Family. (https://github.com/ansible/ansible/pull/83541)

@ -1,2 +0,0 @@
minor_changes:
- find - change the datatype of ``elements`` to ``path`` in option ``paths`` (https://github.com/ansible/ansible/pull/83575).

@ -1,3 +0,0 @@
minor_changes:
- "validate-modules sanity test - detect if names of an option (option name + aliases) do not match between argument spec and documentation
(https://github.com/ansible/ansible/issues/83598, https://github.com/ansible/ansible/pull/83599)."

@ -1,3 +0,0 @@
---
bugfixes:
- debconf - fix normalization of value representation for boolean vtypes in new packages (https://github.com/ansible/ansible/issues/83594)

@ -1,2 +0,0 @@
bugfixes:
- Fix an issue where registered variable was not available for templating in ``loop_control.label`` on skipped looped tasks (https://github.com/ansible/ansible/issues/83619)

@ -1,4 +0,0 @@
---
minor_changes:
- rpm_key - allow validation of gpg key with a subkey fingerprint
- rpm_key - enable gpg validation that requires presence of multiple fingerprints

@ -1,2 +0,0 @@
minor_changes:
- ini lookup - add new ``interpolation`` option (https://github.com/ansible/ansible/issues/83755)

@ -1,4 +0,0 @@
minor_changes:
- >-
``ansible-galaxy collection publish`` - add configuration options for the initial poll interval
and the exponential when checking the import status of a collection, since the default is relatively slow.

@ -1,3 +0,0 @@
bugfixes:
- "runtime-metadata sanity test - do not crash on deprecations if ``galaxy.yml`` contains an empty ``version`` field (https://github.com/ansible/ansible/pull/83831)."
- "Fix ``SemanticVersion.parse()`` to store the version string so that ``__repr__`` reports it instead of ``None`` (https://github.com/ansible/ansible/pull/83831)."

@ -1,4 +0,0 @@
bugfixes:
- >-
include_tasks - Display location when attempting to load a task list where ``include_*`` did not specify any value -
https://github.com/ansible/ansible/issues/83874

@ -1,2 +0,0 @@
bugfixes:
- "dnf5 - re-introduce the ``state: installed`` alias to ``state: present`` (https://github.com/ansible/ansible/issues/83960)"

@ -0,0 +1,2 @@
bugfixes:
- ansible-test - The runtime-metadata sanity test now ignores pre-release and build identifiers in collection versions. This prevents errors if a tombstone version is ``X.0.0``, while the collection's version is ``X.0.0-prerelease`` (https://github.com/ansible/ansible/issues/85193)."

@ -0,0 +1,2 @@
bugfixes:
- apt - Stop the >= operator from being ignored for packages that are not already installed (https://github.com/ansible/ansible/pull/85254)

@ -0,0 +1,2 @@
bugfixes:
- "Fix ``AnsibleModule.human_to_bytes()``, which was never adjusted after the standalone ``human_to_bytes()`` got a new parameter ``default_unit`` (https://github.com/ansible/ansible/pull/85259)."

@ -0,0 +1,5 @@
bugfixes:
- >-
``ansible.builtin.pip`` - Running the built-in pip module with ``check_mode`` and packages coming from VCS URLs, archives, or local filepaths now correctly outputs the ``changed`` status of the task.
Previously, it was always reported as changed due to improper package name resolution.
(https://github.com/ansible/ansible/pull/85623)

@ -0,0 +1,2 @@
bugfixes:
- ansible_virtualization_role and ansible_virtualization_type facts - fix the detection of vms running inside FreeBSD Bhyve hypervisor and detection of jails (https://github.com/ansible/ansible/pull/85767)

@ -0,0 +1,6 @@
---
bugfixes:
- galaxy - previously, some corrupted cache files could cause Ansible Galaxy to fail
with a traceback. This has been corrected to display a clear error message explaining
how to resolve the problem.
(https://github.com/ansible/ansible/issues/85918)

@ -0,0 +1,2 @@
bugfixes:
- psrp - ReadTimeout exceptions now mark host as unreachable instead of fatal (https://github.com/ansible/ansible/issues/85966)

@ -0,0 +1,2 @@
removed_features:
- Removed deprecated ability to import ``datetime``, ``signal``, ``types``, ``chain``, ``repeat``, ``map`` and ``shlex_quote`` from ``ansible.module_utils.basic``.

@ -0,0 +1,2 @@
removed_features:
- Removed deprecated ``handle_stats_and_callbacks`` parameter of the ``StrategyBase._load_included_file`` method. (https://github.com/ansible/ansible/issues/86003)

@ -0,0 +1,2 @@
minor_changes:
- "ansible-test validate-modules sanity test - now reports bad return value keys that cannot be used with the dot notation in Jinja expressions (https://github.com/ansible/ansible/issues/86079)."

@ -0,0 +1,3 @@
---
minor_changes:
- script - remove the currently unsupported ``decrypt`` argument from the module documentation (https://github.com/ansible/ansible/issues/86067).

@ -0,0 +1,6 @@
---
bugfixes:
- >-
iptables - The module can now detect when a extensions added with the module ``match`` argument have
been automatically imported by other module arguments such as ``uid_owner`` and prevents duplicate
extension imports which previously caused an error (https://github.com/ansible/ansible/issues/84387).

@ -1,7 +0,0 @@
bugfixes:
- >-
powershell - Implement more robust deletion mechanism for C# code compilation
temporary files. This should avoid scenarios where the underlying temporary
directory may be temporarily locked by antivirus tools or other IO problems.
A failure to delete one of these temporary directories will result in a
warning rather than an outright failure.

@ -1,2 +0,0 @@
bugfixes:
- ansible-test action-plugin-docs - Fix to check for sidecar documentation for action plugins

@ -0,0 +1,5 @@
bugfixes:
- >-
Windows - ignore temporary file cleanup warning when using AnsibleModule to
compile C# utils. This should reduce the number of warnings that can safely
be ignored when running PowerShell modules - https://github.com/ansible/ansible/issues/85976

@ -1,2 +0,0 @@
minor_changes:
- facts - add systemd version and features

@ -0,0 +1,2 @@
bugfixes:
- modules - fix AnsiballZ wrapper code escaping of sitecustomize

@ -1,2 +0,0 @@
minor_changes:
- ansible-config has new 'validate' option to find mispelled/forgein configurations in ini file or environment variables.

@ -1,3 +0,0 @@
---
bugfixes:
- ansible-doc - make colors configurable.

@ -1,2 +0,0 @@
bugfixes:
- ansible-doc - fixed "inicates" typo in output

@ -1,3 +0,0 @@
---
bugfixes:
- ansible-doc - handle no_fail condition for role.

@ -1,2 +0,0 @@
minor_changes:
- The minimum supported Python version on targets is now Python 3.8.

@ -1,4 +0,0 @@
bugfixes:
- >-
``ansible-galaxy role install`` - update the default timeout to download
archive URLs from 20 seconds to 60 (https://github.com/ansible/ansible/issues/83521).

@ -1,5 +0,0 @@
bugfixes:
- >-
Add descriptions for ``ansible-galaxy install --help` and ``ansible-galaxy role|collection install --help``.
- >-
``ansible-galaxy install --help`` - Fix the usage text and document that the requirements file passed to ``-r`` can include collections and roles.

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy role install - fix symlinks (https://github.com/ansible/ansible/issues/82702, https://github.com/ansible/ansible/issues/81965).

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save