Compare commits

...

1277 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
Abhijeet Kasurde b5263c2c10
isidentifier: Remove Python 2 specific code (#83688)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Matt Clay 7693c892fa
ansible-test - Use Python version in pylint contexts (#83984) 1 year ago
Sloane Hertel bf8da52aac
ansible-galaxy - fix the usage for role/collection install (#83979) 1 year ago
Martin Krizek aa24e97435
dnf5: re-introduce ``state: installed`` alias (#83961)
Fixes #83960
1 year ago
Brian Coca 6efb30b43e
Do not convert floats to ints when there is truncation (#83864)
Adjusted error messages
fixed tests
removed py2 compat tests, since no more py2

Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Sloane Hertel 40ade1f84b
Add mount_facts module (#83508)
* Add a mount_facts module capable of gathering mounts skipped by default
fact gathering

* By default, collect mount facts from standard locations including
/etc/mtab, /proc/mounts, /etc/fstab, /etc/mnttab, /etc/vfstab, and on AIX,
/etc/filesystems.

When no file-based source for the current mounts can be found
(like /proc/mounts), the module falls back to using mount as a source.
This allows BSD and AIX to collect the existing mounts by default, without
causing Linux hosts to use both /proc/mounts and mount output.

* Non-standard locations and "mount" can be configured as a sources.

* Support returning an aggregate list of mount points in addition to first
found.

When there are multiple mounts for the same mount point in an
individual source, a warning is given if the include_aggregate_mounts
option is not configured.

* Add options to filter on fstypes and devices (supporting UNIX shell
wildcards).

* Support configuring a timeout and timeout behavior to make it easier
to use the module as a default facts module without risking a hang.

* Include the source and line(s) corresponding to a mount for easier
debugging.

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
1 year ago
Matt Martz 9ab63986ad
ansible-test no longer needs special casing in `__main__.py` (#83962) 1 year ago
Sloane Hertel 85d9a40aac
Clarify galaxy CLI --help about install locations (#83919)
* add descriptions for `ansible-galaxy install` and `ansible-galaxy role|collection install`

* fix the usage for installing roles and collections together and include collections in the description for -r

Closes #81159

Co-authored-by: Alan Rominger <arominge@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
1 year ago
Brian Coca bcee35385b
timedout extended (#83953)
* timedout extended

* add timedout test
1 year ago
Don Naro f00e3d7762
Update communication links for the forum (#83862)
* update communication details in README

* update comms details in contributing

* update comms details in issue templates

* add link to contributors guide

* point to devel for comms
1 year ago
Jordan Borean b5ae8a382b
runas - create new SYTEM token for become (#83827)
Instead of re-using the token used in impersonation, this change will
create a new token for the SYSTEM account as returned by LogonUser. The
benefits of this is that the token will contain the full privileges for
the SYSTEM account rather than potentially one that has restricted
privileges we used during impersonation. It should also help avoid
problems on Windows that fails on status 0x0000016F when the
impersonated token during become was from a process that is restricted
from creating sub processes.
1 year ago
Gleb Popov 33d4ba8fa2
file module: Clarify the docs that the force parameter works for hardlinks too (#83913) 1 year ago
Brian Coca 47e64dc371
service_facts, fix systemd/ubuntu failed reporting (#83424)
Avoid check description, better comments
1 year ago
Brian Coca d58988d8ff
fact gathering, mounts, fixes for single proc code and tests (#83866)
* Fact gathering fix 'no shm' branhc

* Use concurrent.futures instead of multiprocessing

This entirely avoids the need for fallback logic since the concurrent.futures thread pool does not depend on `/dev/shm`.

Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Matt Clay 31d73b0645
Replace binary_modules Makefile with Python script (#83925)
Also update the platform list:

* Remove linux ppc64le
* Add darwin arm64
1 year ago
Matt Clay a84fa50096
ansible-test - Update base/default containers (#83930) 1 year ago
Matt Clay cf2a4a85da
ansible-test - Update sanity test requirements (#83921) 1 year ago
Matt Clay cd342f76b4
release.py - Use changelog requirements (#83920)
Use the changelog sanity test requirements instead of the package-data sanity test requirements.

This enables removal of most package-data sanity test requirements, as they are no longer used by the test itself.
The additional requirements were being maintained only to provide pinned requirements for building the changelog during a release.
1 year ago
Brian Coca 11e56d9c27
iptables, use existing validation (#83907)
also remove redundant  and wrong test
1 year ago
Sviatoslav Sydorenko (Святослав Сидоренко) 59b3e49d70
Stop suggesting `easy_install` in hacking (#83909)
It's been discouraged for the past decade. And CPython actually ships
with pip nowadays, that is bundled within the built-in `ensurepip`
stdlib module.
1 year ago
Brian Coca 9c49fdd86d
delay keyword changed from int to float (#83901)
* delay keyword changed from int to float

* draft test

* fixed test

* expanded test, fixed 'name' tests also

* cleanup

* fix
1 year ago
Suman Tripuraneni 0f6b58b5f2
Update subset.yml (#83908)
Typo error in examples
1 year ago
Brian Coca 4fa512406b
loop_control "early exit" feature (#62151)
* add a loop_control break_when directive to break out of a loop after any item

* remove loop var as normal exit would

* example usage:

- name: generate a random password up to 10 times, until it matches the policy
  set_fact:
    password: "{{ lookup('password', '/dev/null', chars=character_set, length=length) }}"
  loop: "{{ range(0, 10) }}"
  loop_control:
    break_when:
      - password is match(password_policy)

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
1 year ago
Matt Clay e3ccdaaa2e
release.py - Include pyproject.toml in git add (#83892) 1 year ago
Matt Clay b544ac13ec
release.py - Add missing setuptools arg to prepare (#83887)
* release.py - Add missing setuptools arg to prepare

This allows the prepare command to accept the `--no-setuptools` argument.

It also fixes a traceback when using the `prepare` command.

* Use a more accurate type hint
1 year ago
Matt Davis 24e5b0d4fc
Add DaemonThreadPoolExecutor impl (#83880)
* Add DaemonThreadPoolExecutor impl
* Provide a simple parallel execution method with the ability to abandon timed-out operations that won't block threadpool/process shutdown, and without a dependency on /dev/shm (as multiprocessing Thread/Process pools have).
* Create module_utils/_internal to ensure that this is clearly not supported for public consumption.
1 year ago
Jordan Borean 1a4644ff15
psrp - Remove extras lookups (#83760)
* psrp - Remove extras lookups

Removed the extras variable lookups for the psrp connection plugin. All
valid options are already documented and the extras functionality is
slated to be deprecated at a future point in time. This should have
affect on existing user's playbooks.

* Fix up sanity tests and add explicit boolean conversion test
1 year ago
Jordan Borean 1503805b70
Add location on include_tasks fail inside include (#83876)
Adds the datastore details to the parser error when attempting to
include tasks that contain include_tasks without a filename set. This
change will now display the exact location of the include_tasks that
failed like any normal syntax error.
1 year ago
Matt Clay 4346430003
ansible-test - Reduce scope of empty-init test (#83878) 1 year ago
Matt Clay 49490d92c3
Update boilerplate sanity test (#83879)
The `annotations` future can now be imported as `_annotations`.
1 year ago
John Barker 8b8a249d26
Remove references to IRC or Google Groups (#83875) 1 year ago
Matt Clay 9d42b34ed3
Fix Windows entries in test matrix (#83873)
The display names need to be set so code coverage reporting works.
1 year ago
Jordan Borean 9a5a9e48fc
Improve testing for Windows SSH and other connection plugins (#83834)
Expands the test matrix used for testing on Windows to cover the three
connection plugins we support for all the tasks. This change also
changes how raw commands are run over SSH to avoid starting a
`powershell.exe` process that was uneeded in the majority of cases used
in Ansible. This simplifies our code a bit more by removing extra
Windows specific actions in the ssh plugin and improves the efficiency
when running tasks.
1 year ago
Matt Clay db04499f58 ansible-test - Update nios-test-container to 5.0.0 1 year ago
Martin Krizek 1f987423fd
Print the name of the option being deprecated (#83761)
Fixes #83759
1 year ago
Matt Davis c6a391c8d8
fix delegate_to integration test (#83865)
* the test was previously passing erroneously due to the `timeout` elapsing in CI, and that the `failed` test does not encompass `unreachable`
1 year ago
Brian Coca 2a676ff897
copy, fix permissions and atime on diff partitions (#83824)
we just set time also, when on diff partitions
1 year ago
Felix Fontein faf446a895
runtime-metadata sanity test: do not fail deprecation version checks if galaxy.yml has empty `version` (#83831)
* Do not create invalid SemanticVersion objects.
* Fix SemanticVersion.parse().
* Add basic runtime-metadata tests.
1 year ago
jctanner bed9a9597a
galaxy-cli tasking polling interval from environment variable (#83803)
Added configuration options, including environment variables to control the polling 
No-Issue

---------
Signed-off-by: James Tanner <tanner.jc@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
1 year ago
Jordan Borean b5e0293645
powershell - Improve CLIXML parsing (#83847)
Improves the logic used when parsing CLIXML to support all escaped
character sequences and not just newlines.
1 year ago
Matt Martz 9b0d2decb2
Handle authentication errors and token expiration (#83695)
Fixes #70019
1 year ago
Martin Krizek 5ab5f23487
dnf: stop filtering exceptions by matching on text (#83297)
* Rely on dnf.base.remove, no special handling isn't needed,
  let the dnf internals figure out what is needed to be done.
  This is more in line with what dnf cli does.

* "already installed" in Exception (if it is even a thing) should be
  caught by special exceptions like MarkingError or CompsError. This
  appears to be a historic check that is no longer needed.

Supersedes: #83295
1 year ago
Jordan Borean 69fb629355
Fix up raw_params for ansible.windows modules (#83830)
* Fix up raw_params for ansible.windows modules

Fixes up the logic for detecting if using ansible.windows.win_command or
ansible.windows.win_shell with _raw_params. These two modules are
special in that they can be referenced in 4 different ways but the
ansible.windows collection specific prefix needs to be manually added to
the list.

* Fix up sanity issue
1 year ago
Brian Coca 718ce13673
connection plugins: extras fix (#83353)
Currently we match the load name, which can be an fqcn, but most users expect the 'naked' name
Now plugins can declare that name by setting _extras_prefix property or fallback to 'non fqcn' if no extras prefix
1 year ago
Brian Coca 90de03be50
Gather mount facts, fallback for when multiproc is not feasable (#83750)
* fallback to 'single threaded gathering' for when multiproc fails

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
1 year ago
Jordan Borean 520fa688ba
ssh and psrp - Support more complex characters in fetch_file (#83753)
* ssh and psrp - Support more complex chars in fetch_file

Fixes the psrp and ssh (with piped) fetch function to work with paths
that contains glob like characters in the path. For Windows this was
needed when using paths that contain `[]` in the path. For ssh this was
a problem with FreeBSD when using the piped transfer method with similar
characters.

Also tidies up the psrp logic to not inject the paths and buffer size
in the script but pass it as an object through an argument/parameter.

* Fix sanity check
1 year ago
Jordan Borean dec49e6288
Add explicit winrm/psrp tests for HTTP and HTTPS (#83769) 1 year ago
Jordan Borean 430aaa1960 Fix tests when running against SSH target 1 year ago
Matt Clay 81e025b414 ansible-test - Add Windows remote connection option 1 year ago
Matt Clay a3ee846a64
Use a venv in more integration tests (#83799)
* Use venv for pause test
* Use venv for debugger test
* Use venv for builtin_vars_prompt test
1 year ago
Matt Clay 6eb16faed2
ansible-test - Update base/default containers (#83796) 1 year ago
Matt Clay da02611c48
ansible-test - Update sanity test requirements (#83795)
* Remove PyYAML pin for yamllint sanity test
* Freeze sanity test requirements
1 year ago
Matt Clay ab624ad031
ansible-test - Remove generation of egg-info (#83786)
Also remove egg-info generation from hacking/env-setup scripts.
1 year ago
dkuji 26375e7f12
fix copy module update atime/mtime (#83235)
Ensure we force mtime/atime update when using copystat

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
1 year ago
Martin Krizek 89137cb5a0
Add end_role meta task (#83263)
ci_complete
1 year ago
Sloane Hertel fe7e68bfcb
Fix ansible-vault integration test for missing vault ids (#83777)
* Fix broken, circumvented test for missing vault ids

* verify the command returns a non-zero exit code

Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Martin Krizek 9a54ba5a39
Ensure skipped loop iteration register var is available (#83756)
Fixes #83619
1 year ago
Martin Krizek 5c84220dbb
Fix meta tasks breaking host/fork affinity with host_pinned (#83438)
Fixes #83294
1 year ago
Martin Krizek a0f9bbf3f3
ini lookup: add new interpolation option (#83773)
Fixes #83755
1 year ago
Matt Clay b25afbb4e9
Suppress cryptography warnings for paramiko (#83772) 1 year ago
Matt Clay 68515abf97
Drop use of setup.py and setup.cfg (#81443) 1 year ago
Sloane Hertel 2b91c57c85
atomic_move - fix creating file in directory with setgid bit (#83718)
* fix creating file in directory with setgid bit

* add a test using the copy module's content option to create a file in a directory with setgid bit

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
1 year ago
Kellin 0d6b034103
Enable validation of subkeys in rpm key module (#83716)
* Enable validation of subkeys in rpm key module

A gpg subkey may change while the primary key remains the same. Due to
this behavior, there are situations where validation of the primary gpg
key fingerprint is not sufficient because the desired target is actually
the gpg subkey. This change allows the user to validate against either
the fingerprint of the primary gpg key or its subkey.

Signed-off-by: Kellin <kellin@retromud.org>

* Improve tests, add multi-fingerprint

- Improve tests to cover all cases
- add multi fingerprint validation

Signed-off-by: Kellin <kellin@retromud.org>
1 year ago
akire0ne 7b74de069c
fix: `COLOR_INCLUDED` to colorize `included` output (#83711)
adds color included configuration and applies to include message

Co-authored-by: Achille Myette <amyette@drw.com>
1 year ago
Brian Coca e4d7286298
use diff intermediate var to preserve functionality (#83738)
add tests
1 year ago
Brian Coca 797e6bb220
Add vaulted_file test (#83717)
* Add vaulted_file test
* fix is_encrypted_file while we are here
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
1 year ago
Sloane Hertel 97a60c1e86
Fix csvfile test - quote file argument (#83751)
file was intended to be a string, not an undefined variable
1 year ago
Martin Krizek d9f1866249
Deprecate remaining safe evals (#83293) 1 year ago
Matt Clay 59ca05b709
ansible-test - Update default and distro containers (#83736) 1 year ago
Matt Davis a301ae876e
try disabling negative values win_reboot test (#83735)
* hoping to improve CI stability
1 year ago
Matt Clay 70be017f02
ansible-test - Update mypy and package-data tests (#83734)
* package-data - Test min/max setuptools version

* Fix multi-version abstraction

* Convert mypy test to script based test

* Fix f-string in pymarkdown test

* Sanity test fixes
1 year ago
Matt Clay 717f1092e3
ansible-test - Update venv management and sanity requirements (#83729)
* ansible-test - Update venv management
* Upgrade from pip 24.0 to 24.2
* Omit `wheel` and `setuptools` from ansible-test managed virtual environments
* Drop pre-release hacks
* Update mypy requirements
* Freeze sanity test requirements
* Update sanity test configuration
* Update sanity ignores
1 year ago
Sloane Hertel 0be66ed6dc
Fix task-adjacent search path in roles (#83621)
* Restore search path in the current task file’s directory for roles
1 year ago
Sloane Hertel 26c8a28d05
csvfile lookup - fix giving an error when no search term is provided (#83710)
Fixes #83689
1 year ago
Brian Coca 885e3766a8
core: raw params better error msg (#83726)
* less confusing error msg
* also remove 'removed' include
1 year ago
Brian Coca c5210ad3eb
Fix display to log severity mapping (#83712)
add caplevel to display to pass through
also reverse dict order as 'last update wins'
added tests ... and also log severity to log

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
1 year ago
Matt Clay ac5ed40a21
Fix type hints and misc mypy/pylint issues (#83724) 1 year ago
Matt Clay 6019f3f425
ansible-test - Update coverage to 7.6.1 (#83723) 1 year ago
Matt Clay 4e69d83fac
release.py - Auto-update setuptools upper bound (#83713)
When releases are prepared, the upper bound on setuptools in pyproject.toml will be automatically updated
to the latest version available on PyPI. This version will then be tested by the package-data sanity test
during the release process and will be used to build the release.

This change ensures that a released version of ansible-core can be built in the future if a new setuptools
release includes breaking changes that would prevent building a functional package. If a downstream package
maintainer requires a newer setuptools version than the upper bound permits, they can patch pyproject.toml
as needed. Since ansible-core releases support specific Python versions, lack of support for new setuptools
releases will have no effect on support for future Python versions.
1 year ago
Abhijeet Kasurde 207a5fbebb
test: Handle Singleton Display class (#83673)
Fixes: #83538

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 91f680a749
Remove extraneous get_bin_path call (#83675)
ip_path is already calculated before calling get_interfaces_info

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
1 year ago
Matt Clay 5ae8b5b3a6
Remove EXTERNALLY-MANAGED marker in apt test (#83706)
The marker is removed in ansible-test managed environments, but the apt test restores it
by installing/upgrading packages. To avoid breaking later tests, the marker needs to be
removed again.

ci_complete
1 year ago
Abhijeet Kasurde 245885177c
systemd facts: Handle AttributeError (#83684)
* Handle AttributeError raised while running systemd facts on
  non-systemd hosts

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 31ad786de1
ansible-doc: handle on_fail (#83676)
Handle errors raised when role doc has errors

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
skupfer 20465ba11a
Add UID and GID min/max keys (#81770)
Fixes: #72183
1 year ago
Karl G 6bf6844a1c
add error handling when parsing values in ini files (#82718)
Fixes: #82717

Co-authored-by: Karl A. Grindley <kgrindley@ll.mit.edu>
1 year ago
Abhijeet Kasurde c6d5be5cac
test: update tests (#83686)
* Remove commented code
* Enable disabled tests
* Formatting

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 3daf01e270
tests: use keyserver with keyid while using apt_key (#83694)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Jordan Borean bbf96c250f
winrm - quota retry handling (#83656)
* winrm - quota retry handling

Add a retry attempt when receiving ERROR_WSMAN_QUOTA_MAX_OPERATIONS when
starting a command. This can occur when running a loop with multiple
iterations or an action plugin that runs multiple commands.

* Update pywinrm constraint for test

* Add verbose hint and mark test as destructive
1 year ago
Sloane Hertel ff5deaf62f
fix module_defaults group incorrectly giving deprecation warnings (#83510)
don't display deprecation warnings for actions/modules as a result of using an action_group containing a deprecated plugin
1 year ago
Abhijeet Kasurde d23a2de5f2
Remove selinux import (#83674)
Remove selinux import which was kept for backward compatibility

Fixes: #83657

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Martin Krizek 07a1d6a3fd
dnf/setup_rpm_repo: simplify dummy testing repos (#83624)
This change simplifies construction and footprint of testing rpm
repository created by rpmfluff:
* all packages default to noarch
* only when necessary build package for a specific architecture(s)
* do not build several repositories each for specific arch
* remove duplicate "incompatible arch" test
* skip_broken_and_nobest: move testing packages from an external repo
  into our dummy repo for transparency
* remove compatibility code from create_repo.py for versions no longer
  needed
* remove support for old OS versions from setup_rpm_repo
* simplify representation of an rpm in create_repo.py to allow easier
  changes

Notes
* there is one more external testing repo used at
https://ci-files.testing.ansible.com/test/integration/targets/setup_rpm_repo/repo-with-updateinfo
1 year ago
Felix Fontein 3d4bd79574
validate-modules: detect names set mismatch between argument spec and documentation (#83599) 1 year ago
Lee Garrett 7e3916b767
Typo fixes and other bits and bobs (#83672)
Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
1 year ago
Abhijeet Kasurde 8e74cdc7b2
Set LANGUAGE env variable is set to a non-English locale (#83671)
Fixes: #83608

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Jordan Borean a3a92bcc13
Remove explicit shell environment docs (#83649)
Removes the docs for the environment keyword in the shell base plugins
as they are a no-op in the plugins themselves. The environment value is
provided by the action base which gets it from the action base on the
task.environment value. This should avoid confusion around how its being
set and removes some code that is not used at all.
1 year ago
Abhijeet Kasurde fe1183f8ac
Replace random with secrets (#83668)
Use secrets library instead of random.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Abhijeet Kasurde 504f5b1230
apt: Report change when package is removed (#83547)
While upgrade process removes a package, module should
report changed=True instead of changed=False

Fixes: #46314

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Sloane Hertel 33565f3774
increase timeout downloading galaxy role URLs (#83562)
* Update the timeout to download role archive to 60 seconds to match collections
TODO: in future make a configurable 'artifact download timeout'
1 year ago
Abhijeet Kasurde cd105d479a
display: warn user about empty log path value (#83381)
Fixes: #79959

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
TeekWan 6371a883d4
Added info about MacOS targets for cron module (#83620)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Matt Clay 79f819dc54
ansible-test - Remove VyOS tests and support files (#83650)
The VyOS remote image required for running the tests is no longer functional.
1 year ago
Alexei Znamensky d36dc70afc
remove ignore clauses for module find (#83575)
add testcase for expanding home dir names
1 year ago
Alexei Znamensky a60fb178b1
docs adjustments (batch 1) (#83341) 1 year ago
krescent 46ff7594a4
env: update examples for setting default values to variable (#83370) 1 year ago
Matt Clay f261a6142f Use build instead of pep517 for integration test 1 year ago
Matt Clay b90c3a8de5 Revert "🧪 Use `setuptools [core]` @ collections_runtime_pythonpath (#83627)"
This reverts commit 0d5460df16.
1 year ago
Sviatoslav Sydorenko (Святослав Сидоренко) 0d5460df16
🧪 Use `setuptools [core]` @ collections_runtime_pythonpath (#83627) 1 year ago
Alexei Znamensky eeb9b50669
remove ignore clauses for module lineinfile (#83595) 1 year ago
Peter A. Bigot c904bffc7d
debconf: handle boolean value representation consistently (#83601)
* lift code that normalizes value type for boolean vtype to cover both
  branches of conditional.
* remove obsolete and incomplete conversion of type in set_selection.

Fixes: #83594
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
1 year ago
Alexei Znamensky 4408b2c3e1
replace - fix documentation and remove ignore clauses (#83574) 1 year ago
Matt Clay 906c969b55
ansible-test - Improve unknown env error message (#83610) 1 year ago
Alex Barth 506d12de69
Update any.yml (#83588)
* fixed typo in description
* fixed comment in examples
1 year ago
Brian Coca 0eeb933238
module compression is now again settable via var (#83573)
Previous change overlooked 'uncommenting' the variable entry as a way to update this  to keep the functionality.


Co-authored-by: Glandos <bugs-github@antipoul.fr>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Alexei Znamensky 08de64076a
remove ignore clauses for module blockinfile (#83577) 1 year ago
rebtoor 7cf7dff3a6
Ensure that we are handling DownloadError properly in the dnf module (#83543)
Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
1 year ago
Martin Krizek 28cef00576
dnf: follow-up on is_newer_installed arches fix (#83556)
* dnf: follow-up on is_newer_installed arches fix

* fix for the non package object case

* prevent early bailout in dnf _is_newer_version_installed
* non-installed available arches would fail out of the check early

---------

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
1 year ago
Alexei Znamensky 293bba7533
fix misc. documentation typos and formatting for modules starting with u-y (#83422) 1 year ago
Alexei Znamensky 313f9d9f69
fix misc. documentation typos and formatting for modules starting with s (#83420) 1 year ago
Matt Clay 9cdfcd9aed
ansible-test - Update nios-test-container to 4.0.0 (#83539) 1 year ago
Matt Clay 10997ab3aa
ansible-test - Update base/default containers (#83553) 1 year ago
Matt Clay 20a815b03f
Quality-of-life improvements for release tool (#83551)
* Quality-of-life improvements for release tool

- Default devel releases to b1
- Default non-devel releases to rc1
- Default to release announcement to console
- Avoid auto-links in GH release annoucements for file sizes
1 year ago
Alexei Znamensky 4a1775acd3
review modules docs - batch(fragments) (#83431)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
1 year ago
Dhanesh R 9472005dee
update distro version to 1.9.0 (#83540) 1 year ago
flowerysong 4f6a4534a7
known_hosts: don't modify `AnsibleModule.params` (#83517)
Using this dictionary to store the return values results in
the return values showing up in the returned
`invocation['module_args']`, which is confusing. It also causes all
module arguments to be returned, which is preserved by this change but
should ideally be removed in the future.
1 year ago
Jan Christian Grünhage 83a0975611
Add dinit as a service_mgr (#83489) 1 year ago
Harshvardhan Sharma 43346f1fdc
Add SL-Micro to Suse family list (#83541) 1 year ago
MajesticMagikarpKing edce798713
Fix Creating user directory using tilde always reports "changed" (#83113)
Fixes: #82490
1 year ago
Felix Fontein e5309ba29f
validate-modules: reject option/alias names equal up to casing belonging to different options (#83530)
* Reject option/alias names equal up to casing belonging to different options.

* Update test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
1 year ago
flowerysong 63538f7779
package_facts: fix warning logic (#83520)
* package_facts: fix warning logic

* Refactor so that warnings can work
1 year ago
Martin Krizek 775bc1110e
linear: fix included handlers executing in lockstep (#83209)
Fixes #83019
1 year ago
Martin Krizek 571e2a9551
Fix incorrect rc when executing end_host in rescue (#83522)
Fixes #83447
1 year ago
Brian Coca 6c0f4c8a2d
hostvars templating fix, override serialization (#83509)
fixes #82872
nicer implementation courtesy of nitzmahone
1 year ago
Felix Fontein 7d678cbd96
Fix require_only_one. (#83511) 1 year ago
Brian Coca 00ddc27d69
actually show plugin config warnings/deprecations (#82593)
previouslly we recorded but did not show to avoid spam
since we could not dedup from forks, that was already
fixed in another PR so now we can show/display them.

Also:
  * funcitonalize deprecation msg construct from docs
  * reuse formatting func in cli
  * normalize alternatives: most of the code used intended plural
    but some and most data/tests used the singular
  * update schemas and tests

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
1 year ago
Tiago R. Cunha 101f017ef5
Replace references to archived ansible/ansible-examples repository (#83500)
* Replace references to archived ansible/ansible-examples repository

* Update examples to reference ansible repository

* Include HTTPS among SSH references in examples
1 year ago
Martin Krizek a8e4106c47
Fix tb for when env var contains % (#83499)
Fixes #83498

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
1 year ago
Martin Krizek 665d2e15d7
dnf: remove legacy code (#83298) 1 year ago
Benoît Knecht 41ba6536cf
facts/hardware: Fix support_discard block device fact (#83480)
Previously, `support_discard` simply returned the value of
`/sys/block/{device}/queue/discard_granularity`. When its value is `0`, then
the block device doesn't support discards; _however_, it being greater than
zero doesn't necessarily mean that the block device _does_ support discards.

But another indication that a block device doesn't support discards is
`/sys/block/{device}/queue/discard_max_hw_bytes` being equal to `0` (with the
same caveat as above). So if either of those are `0`, set `support_discard` to
zero, otherwise set it to the value of `discard_granularity` for backwards
compatibility.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
1 year ago
Martin Krizek 2930a4664c
dnf - arches must be the same in the is_newer_installed check (#83417)
Fixes #83406
1 year ago
sminux 7a3f9384cf
Fix simmilar branches (#83497)
Identical branches in conditional node: 'elif name != permanent_hostname' and 'else'. First bruch is not nessesary

Co-authored-by: mar.s <marchenkov.s.d@gmail.com>
1 year ago
Martin Krizek 0ee6e39615
dnf, dnf5: fix installing via wildcard (#83481)
Fixes #83373
1 year ago
Matt Clay 8f1fddb161
Enable Ubuntu 24.04 group 6 in CI (#83466)
* Enable Ubuntu 24.04 group 6 in CI

* Disable rootfull Podman on Ubuntu

* Disable unix-chkpwd AppArmor profile on Ubuntu for Fedora 40 tests

* Document AppArmor and rootfull issues
1 year ago
Brian Coca 0d28705ce5
linear strategy, show templated task name on start (#83473)
we only templated in some cases but when queueing we could get an untemplated name for the 'on start' event.
1 year ago
Brian Coca 339452c105
Ensure the correct connection name is shown in results (#83354) 1 year ago
Thomas Sjögren f7dee8aaf8
add support for inactive option (#83355)
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
1 year ago
Matt Clay a121a169e3
ansible-test - Replace FreeBSD 14.0 with 14.1 (#83477) 1 year ago
Abhijeet Kasurde c93af4e148
unarchive: handle content and size differences (#83454)
Consider content differs and size differs while unarchiving
the same tar.gz file

Fixes: #29610

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Danilo Bargen c2c6005842
get_url: Verify checksum using tmpsrc, not dest (#64092)
Previously, if the checksum of the downloaded file did not match the
specified checksum, the *destination* file was removed. This possibly
leaves the system that is being provisioned in an invalid state.

Instead, the checksum should be calculated on the temporary file only.
If there's a mismatch, delete the *temporary* file, not the destination
file.

This requires checking the checksum before moving the file.
1 year ago
Matt Clay 96c04e9d1d
ansible-test - Update PyPI and utility container (#83475) 1 year ago
Felix Fontein 1b42af5004
ansible-test: update http-test-container to 3.2.0 (#83469) 1 year ago
MajesticMagikarpKing d62496fe41
human_to_bytes: strictly parse strings (#83403)
Fixes: #82075
1 year ago
Martin Krizek df29852f3a
Update the dnf5 copr repo (#83459)
The dnf-nightly is the official nightly repo now.
1 year ago
Abhijeet Kasurde 224853b684
replace: update after/before example (#83453)
Fixes: #83390

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
shiftyphil dc31b6cf55
service_facts on OpenBSD: Don't crash on '=' in rcctl flags. (#83458)
Splitting on all '=' characters produced too many values.
1 year ago
Matt Clay dad6f07731
ansible-test - Update tested platforms (#83446)
* ansible-test - Update tested platforms

* Add work-around for Alpine tests

* Fix prepare_http_tests on Fedora

* Fix deb-src setup for Ubuntu 24.04+

* Set multiarch_test_pkg for Ubuntu 24.04

* Update AZP test matrix
1 year ago
Rob Garcia c1a082c697
Added docstrings to V2 methods in the CallbackBase Class (2 & 3 of 27) (#83342) 1 year ago
Matt Clay 44f22162cb
Remove timezone support module and tests (#83465)
The timezone support module was used only for changing the timezone in the user module integration tests.

Changing the timezone for the tests is unecessarily complex for the purpose of asserting proper parsing of user expiration times.
1 year ago
Matt Clay f4751766db
selinux compat - add ignore, proper ex chaining (#83460) 1 year ago
Martin Krizek b2a289dcbb
Remove Python 3.10 support for the controller (#83221)
Fixes #83094
1 year ago
Abhijeet Kasurde 6382ea168a
vault: Handle directory value to vault password file (#83384)
When vault password file env variable is set to blank,
this value is converted to CWD and passed for further
processing.
Check if ANSIBLE_VAULT_PASSWORD_FILE is not a directory.

Fixes: #42960

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
flowerysong 1ed29416db
dnf: update `use_backend` documentation (#83429)
* add note about backwards compatibility
1 year ago
Gilson Guimarães e64c6c1ca5
unarchive: Better handling of files with an invalid timestamp in zip file (#81520)
Fixes: #81092

Signed-off-by: gilsongpfe <gilson.gpf@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Colin Nolan a0aad17912
Adds `limit` parameter to `ansible.builtin.find` (#83153)
* Explicitly guarantee topdown search.
* Makes max matches unlimited == None.
1 year ago
Alexei Znamensky 1c156e2b70
review modules docs - batch(klmpr) (#83418) 1 year ago
Matt Clay 5af5b4b6c8
ansible-test - Update PyPI test container to 3.1.0 (#83432) 1 year ago
Matt Clay 738180d240
ansible-test - Fix unit test coverage collection (#83433) 1 year ago
Luke Davidson 72a5957720
Fix Linux Sector count Fact (#81246)
* Use sectorsize fact in disk size calc rather than hardcoded 512

* Added conversion for sysfs sectorcount to real sector count
1 year ago
Jordan Borean a9b902f579
ansible-test action-plugin-docs sidecar (#83325)
Fix to have ansible-test sanity --test action-plugin-docs to check for
action plugin documentation inside a sidecar file rather than a Python
module.
1 year ago
Abhijeet Kasurde 6e8a7ed327
Revert warning message in setup/gather_facts (#83427)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay cf265eb14d
Add Python 3.13 support (#83416)
* Add Python 3.13 support

* Add temporary work-around for yamllint test
2 years ago
Matt Martz 126ffc7947
Specify -O in windows ssh tests as needed for scp to work with openssh 9+ (#83426) 2 years ago
flowerysong 5022415887
Clarify documentation for `INJECT_FACTS_AS_VARS` (#83404) 2 years ago
Alexei Znamensky c6ba5a3560
docs adjustments - batch(ghi) (#83399)
* review modules docs - batch(ghi)

* fix option markup in gather_facts
2 years ago
Matt Clay 14df8c2cf2
ansible-test - Prepare for Python 3.13 (#83414)
Includes an update to `coverage` and pinned Python requirements.
2 years ago
Abhijeet Kasurde d16ad25e4b
Remove extraneous pylint ignore (#83257)
* Pylint issue 511 is closed, remove ignore related to that.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Alexei Znamensky 4f73d2ff7a
docs adjustments (#83369) 2 years ago
Matt Clay 531bc9891f
Fix issues reported by mypy (#83413) 2 years ago
Matt Clay 6ab26707de
Fix quoting in fork_safe_stdio test (#83412) 2 years ago
Martin Krizek cbbf06893e
Validate and process Handler.listen only once (#83400)
Fixes #83392
2 years ago
Matt Clay 2e60bef855
Update azure-pipelines-test-container (#83302) 2 years ago
Sloane Hertel bdc1cdfa54
Revert "bool filter, add booleanization strategy option (#83362)" (#83391)
This reverts commit 655a8ff38f.
2 years ago
Matt Martz 93b8b86067
Properly quote all needed components of shell commands (#83365)
* Properly quote all needed components of shell commands

* Use self.quote, add new self.join
2 years ago
Sloane Hertel 68638f4710
fix any_errors_fatal tests (#83389)
* fix any_errors_fatal test to exit on non-zero rc

Use a typo in the debug msg to avoid matching play recap

* remove duplicate 'set -ux'
2 years ago
Alexei Znamensky 70c2b35210
docs adjustments (batch 2) (#83368)
* docs adjustments

* Update lib/ansible/modules/assemble.py

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

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 655a8ff38f
bool filter, add booleanization strategy option (#83362)
also make the YAML booleanization the same as spec/JSON/module function
 previous 'aproximation' was missing several options.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 16ebeb7d21
facts: add facts about x86_64 flags to detect microarchitecture (#83356)
Fixes: #83331

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 0a311f6669
additional timeout info (#83364) 2 years ago
Brian Coca c77ed376c4
timeout give extra info (#83206)
the new field shows the python code in execution when it timed out, 99% of the time it will be on a selector waiting for output from ssh to remote.
2 years ago
MajesticMagikarpKing e07b4edc54
Fix Test failure with cowsay installed/present (#83347) 2 years ago
Jordan Borean b8f1add983
powershell - Improve Add-Type tempdir handler (#83080)
Improves the Add-Type temporary directory handler to include a retry
mechanism and not fail on an error. Deleting a temporary file used in
compilation is not a critical error and should improve the reliability
of Ansible on Windows hosts.
2 years ago
Rob Garcia 347a822a42
Documented v2_runner_on_failed method in Callback class (#83267)
* Documented v2_runner_on_failed method in Callback class

* Added changes requested by @bcoca.
2 years ago
Benoît Geeraerts 454dd9e91d
The extension returned by the splitext contains the dot (#82803)
Fixed examples for splitext filter plugin
2 years ago
Abhijeet Kasurde 153c979662
test: Cleanup facts/network/* tests (#83256)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Sloane Hertel f2435375a8
Fix task.resolved_action callbacks (#82003)
* Fix task.resolved_action for callbacks when playbooks use action or local_action

* Fix using module_defaults with 'action' and 'local_action' task FA and add a test case

Fixes #81905
2 years ago
odra 46168c8cc2
file module, follow symlink when doing hardlink (#34228)
Fixes: #33911
2 years ago
Brian Coca 000bac9a3e
gather_facts, mention ansible_facts_parallel var (#83278) 2 years ago
Brian Coca 949c503f2e
config, integrate dynamic galaxy servers (#83129)
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2 years ago
Abhijeet Kasurde 375d3889de
ansible-doc: make color configurable (#83311)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 3253189b33
get_url: update docs for checksum (#83305)
If user provides checksum URL which requires basic auth,
then module parameter username and password is used to
download the checksum file.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 3af9d0f189
apt_*: add more info message while updating apt cache (#83230)
Fixes: #77941

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde c1d41ee44e
filter: update the documentation for win_splitdrive (#83301)
Fixes: #83299

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Eric Appelt 10f9b8e655
Correct code comment in PBE to reflect current behavior (#83269)
Correct a code comment in the PlaybookExecutor class that explains
the host failure condition under which the PBE breaks out of the
run. This comment previously stated that the maximum failure
percentage was checked, but that logic has been refactored into
the linear strategy plugin.
2 years ago
Matt Clay 560d3af097
ansible-test - Update http-test-container (#83272)
* Disable cipher suite integration tests

When the client and server both support TLS 1.3, cipher suite selection is effectively a no-op.

Python provides no way to disable TLS 1.3 cipher suites, and no way to prefer user-selected cipher suites.
Since TLS 1.3 includes a mandatory cipher suite, this makes it impossible to induce a cipher suite related error when using TLS 1.3.

* Update multipart form-data integration test

* Fix netrc integration tests

* Update HTTP test host substring

* ansible-test - Update http-test-container
2 years ago
Matt Clay b8483adb33
ansible-test - Update pypi-test-container (#83273) 2 years ago
Matt Clay 930f18ea65
ansible-test - Update ansible-test-utility-container (#83274) 2 years ago
sournoodl a7e666829e
MUNI tech writers: timeout documentation. (#83152)
* Documentation on the timeout keyword

* wording changes

* keyword description wording edit

* removed whitespace at the end of lines.

* Changed to more accurate wording

---------

Co-authored-by: Niko Mlynarčik <536617@mail.muni.cz>
2 years ago
Martin Krizek c5114e1819
Remove deprecated VariableManager._get_delegated_vars (#83259)
Fixes #82950
2 years ago
Abhijeet Kasurde b70248eb22
Warn if the binary is unavailable using get_bin_path (#83258)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 7e0a476ba2
setup module, make missing sysctl minor issue (#81297)
Signed-off-by: Brian Coca <brian.coca+git@gmail.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde ac6200b597
Refactor dmidecode fact gathering code (#83211)
* Code now bails out early if dmidecode command is unavailable

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Sloane Hertel 65638b4d01
remove old install info when installing collections (#83194)
* Fix cleaning up galaxy server info from previous installations

* changelog
2 years ago
Abhijeet Kasurde f7d7890df9
Use inclusive word: logical (#83232)
Use word 'logical' instead of non-inclusive word

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Martin Krizek 8ad68f12ee
Refactor yum_repository, deprecate yum only options (#83116) 2 years ago
Martin Krizek 3c280e6c1b
dnf5: implement enable_plugin and disable_plugin options (#83105)
80cfea9c25
2 years ago
Abhijeet Kasurde 036d14f1e6
Darwin: add unit tests for hardware fact gathering (#83212)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Martin Krizek 523745e02e
dnf: integration tests cleanup (#83203)
* remove no longer needed tasks
* remove workarounds
* consolidate conditionals
* remove distros/versions from conditionals that are no longer present
  in CI
2 years ago
Florian 45a30ab093
package_facts: apk fix when cache is empty (#83132) 2 years ago
Brian Coca 504bdae894
added examples for systemd service usage (#83192)
mostly how to filter/manipulate the results
---------

Co-authored-by: flowerysong <junk+github@flowerysong.com>
2 years ago
Abhijeet Kasurde 57a8eca3af
pymarkdown: update docs (#83150)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Peter Whall 417db213c0
facts: Update RAID devices regex for FreeBSD (#82081)
Added support FreeBSD RAID devices and regex to match partitions as well as slices. 
RAID device list is taken from here: https://github.com/freebsd/freebsd-src/blob/main/usr.sbin/bsdconfig/share/device.subr
2 years ago
Brian Coca aed8c080f6
ansible-galaxy, clarify licensing for 'init' templates and results (#83175) 2 years ago
flowerysong f5b945bf6a
ansible-doc: fix typo in output (#83205) 2 years ago
Jens Carl eb3ea3ce5c
Fix order of CLI arguments on FreeBSD (#81377)
When passing arguments on FreeBSD to service command the order is
important, otherwise the service command will ignore the arguments.
2 years ago
Matt Clay 6aa8192131
Multi-arch support for container test (#83196) 2 years ago
Matt Clay 3461f1d757
Build test modules for aarch64 (#83195) 2 years ago
Abhijeet Kasurde f4bbd75a3c
git: Check if version is populated or not (#82173)
Before usage check if the git version is populated or not.

Fixes: #72321

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 2816922cd6
display: fix log verbosity (#83179)
* display, ensure we have a logger before we log
2 years ago
Matt Davis 889012e29e
clean up ansible-connection (#82992)
* clean up ansible-connection stuff

* eliminate unnecessary usage of pty/termios
* always use default pickle protocol
* remove unnecessary wire hashing

Co-authored-by: Kate Case <this.is@katherineca.se>
2 years ago
Brian Coca ad777cba5a
package_facts add alias support (#83149)
* package_facts add alias support

fixes #83143

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Martz dc6b77beca
Don't hardcode the dnf module, dynamically select one (#83183) 2 years ago
Abhijeet Kasurde 2b65166a29
uri: deprecate 'yes' or 'no' value in follow_redirects param (#83169)
* uri (module and lookup): deprecate 'yes' or 'no' value in follow_redirects param

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Martz cd9c4eb5a6
Gather sysinfo facts on s390 (#83157) 2 years ago
Felix Fontein 585ef6c55e
Show examples in role entrypoint argument specs. (#82671) 2 years ago
Felix Fontein e3d4c20f6e
Correctly treat separate paragraphs in top-level descriptions as separate paragraphs. (#83155) 2 years ago
Jordan Borean 2ed6c30929
Add version ceiling for pypsrp (#83122)
* Add version ceiling for pypsrp

Add a version ceiling for the pypsrp requirements. This ensures that the
future v1.0.0 release won't impact existing users who install the
library using the version range specified.

* Use constraints file

* Add changelog for this change
2 years ago
Don Naro dfc559866a
minor fix for misspelling (#83156)
This change fixes a minor spelling error, indivudually ==> individually.
2 years ago
Abhijeet Kasurde 802e95f580 distro: remove pep8 ignore
* Remove unnecessary pep8 from ignore.txt

Fixes: #80840

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 628ce5a62e assemble: update argument_spec with 'decrypt' option
* decrypt option is used by assemble action plugin.
  Add this parameter to remove failure raised by
  validate-modules:nonexistent-parameter-documented

Fixes: #80840

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Alex Willmer d5edb77db4 Add description of ansible.utils.path.unfrackpath() basedir argument 2 years ago
Brian Coca c18e755b82 removed extra ansible_managed 2 years ago
Sloane Hertel e84240db84
Fix installing roles containing symlinks (#82911)
* Fix installing roles containing symlinks

Fix sanitizing tarfile symlinks relative to the link directory instead of the archive

For example:

role
├── handlers
│   └── utils.yml -> ../tasks/utils/suite.yml

The link ../tasks/utils/suite.yml will resolve to a path outside of the link's directory, but within the role

role/handlers/../tasks/utils/suite.yml

the resolved path relative to the role is tasks/utils/suite.yml, but if the symlink is set to that value, tarfile would extract it from role/handlers/tasks/utils/suite.yml

* Replace overly forgiving test case with tests for a symlink in a subdirectory of the archive and a symlink in the archive dir when these are not equivalent.

* Build test case from role files to make it easier to add test cases

Fixes #82702
Fixes #81965
Fixes #82051
2 years ago
Brian Coca 124d03145c
inspect components, ansible_managed templatable (#83053)
* inspect components, ansible_managed templatable

fixes #82322
2 years ago
Hrishikesh Mishra 718edde465
Update distro version in __init__.py (#83114)
Update the bundled package distro from 1.6.0 to 1.9.0 in __init__.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Sven 33d1224e83
password_hash: update docs about bcrypt (#81675)
Signed-off-by: Sven Kieske <kieske@osism.tech>
2 years ago
Martin Krizek 87bead3dcf
setup_rpm_repo/create_repo: "Arch dependent binaries in noarch package" (#83108)
This fixes "Arch dependent binaries in noarch package" error cause by
including files created by make_elf function in noarch packages. While the
error only manifests itself on EL 7 and 8 it is better to use files
suitable for noarch packages to prevent the error potentially
re-occuring in the future.
2 years ago
Thomas Sjögren 7f93f6171d
add systemd version and features fact (#83083)
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2 years ago
Abhijeet Kasurde 5dac5d365a
systemd_service: handle failure when mask operation fails (#83079)
* Handle the mask operation failure instead of just
  marking state changed.

Fixes: #81649

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Thomas Sjögren ae2234f185
add countme option to yum_repository (#82831)
* add countme option to yum_repository

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* Update lib/ansible/modules/yum_repository.py

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

* add changelog fragment

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add version_added

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* Update lib/ansible/modules/yum_repository.py

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

* Update lib/ansible/modules/yum_repository.py

* Update lib/ansible/modules/yum_repository.py

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

* Update lib/ansible/modules/yum_repository.py

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2 years ago
Abhijeet Kasurde 6b3bab6476
plugin: fixed examples of csv lookup plugin (#83068)
Fixes: #83031

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 8c3c694472
test: remove ansible-examples.git repo (#81600)
* test: remove ansible-examples.git repo

* To speed up git tests remove reference to ansible-examples.git

Fixes: #81327

* Make CI green

Signed-off-by: Ansible Test Runner <noreply@example.com>
Co-authored-by: Ansible Test Runner <noreply@example.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2 years ago
Brian Coca 0c51a30d93
ansible-config: add 'validate' option (#83007)
We can now validate both ansible.cfg and 'ANSIBLE_' env vars
match either core (-t base), installed plugin(s) (-t <plugin_type>) or both (-t all)
2 years ago
Matt Clay 8bc0d809a6 Update sdist path in release tool
The latest setuptools package uses a normalized package name for the sdist.
2 years ago
Martin Krizek a3cdd831b3
handlers: fix executing in lockstep using linear (#83030)
Fixes #82307
2 years ago
Ernie Hershey 82d91f0952
Make inventory --list help text wording consistent (#83035) 2 years ago
Matt Martz 57750e2cf7
Fallbacks for brand new APIs that don't exist in released dnf5 (#83022) 2 years ago
Martin Krizek 3a6f825a8e
dnf - honor installroot and substitutes in paths (#83011)
In #80094 support for var substitution for cachedir was added but there
are more options that should be supported. Using an API for
prepend_installroot which should be done anyway provide that feature
so use that. In addition, perform the operation once all substitutes
are in place (releasever as well).
2 years ago
Martin Krizek 4e57249d59
dnf5: replace removed API calls (#83020)
* dnf5: replace removed API calls

bfb6f32e15
96c9188f9c

* call set_group_with_name instead of setting group_with_name

c7b88428f3

---------

Co-authored-by: Matt Martz <matt@sivel.net>
2 years ago
Abhijeet Kasurde cb81801124
facts: Add a generic detection for VMware product name (#83012)
* Use startswith instead of hardcoded values in VMWare product
  detction

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
David Greaves 3076478892
Extend systemctl is-enabled check to handle "enabled-runtime" too. (#77754)
In general the existence of a runtime-enabled unit should not prevent
a persistent enable being set.

Specifically this handles the case where there is an entry in fstab
for a mount point (which is retained to allow manual mount/umount to
take place) and yet a systemd mount unit needs to be deployed to
handle other unit options. There will be a generator-created unit file
which shows the unit as enabled-runtime and the persistent enable of
the mount unit will fail.

Additionally improve the comments and modify the code to use rsplit()
and the "in" notation since "systemctl is-enabled" is documented to
return specific values in the cases of interest.

---------

Signed-off-by: David Greaves <david@dgreaves.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Benoît Knecht d304fd86c2
modules/dnf: Substitute variables in DNF cache path (#80094)
The cache directory can be specified with variables that are expanded by DNF, for example,

```
cachedir=/var/cache/yum/$basearch/$releasever
```

But the `dnf` module would use that path literally, instead of replacing
`$basearch` and `$releasever` with their values.

This commit ensures that variables in `cachedir` are properly substituted.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2 years ago
Brian Coca 46137127a2
ansible-config: ensure we get templated default (#82974)
AKA all defaults rendered
2 years ago
Abhijeet Kasurde bb138b1f6e
play_context: remove deprecated PlayContext.verbosity (#82993)
Fixes: #82945

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay cd365057d3 Remove more Python 2.x compat code 2 years ago
Matt Clay 5187061939 ansible-test - Update base/default containers 2 years ago
Sloane Hertel 61e18572bb
Play - remove deprecated ROLE_CACHE in favor of role_cache (#82979) 2 years ago
Abhijeet Kasurde 92feda2e13
paramiko_ssh: remove deprecated ssh_*_args parameters (#82988)
* removed ssh_args parameter
* removed ssh_extra_args parameter
* removed ssh_common_args parameter

Fixes: #82939
Fixes: #82940
Fixes: #82941

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Martin Krizek 14a2f6e2ab
Remove Python 2 traces from dnf/dnf5 modules (#82985) 2 years ago
Sloane Hertel 971c49b711
Remove deprecated vars keyword syntax as a list of dictionaries, it is now required to be a single dictionary (#82980)
Update unit test
2 years ago
Sloane Hertel e03fcda6da
Remove deprecated configs for DEFAULT_FACT_PATH, DEFAULT_GATHER_SUBSET, and DEFAULT_GATHER_TIMEOUT (#82978)
Instead, set module_defaults at the play level, which will apply to the
gather_facts keyword as well as any
ansible.builtin.setup/ansible.builtin.gather_facts tasks.

- hosts: all
  gather_facts: yes
  module_defaults:
    ansible.builtin.setup:
      fact_path: /path/to/facts.d/
      gather_subset: '!all,!min,local'
      gather_timeout: 20
  tasks:
    # also applies to:
    - ansible.builtin.setup:
    - ansible.builtin.gather_facts:

If you wish to only apply these to the gather_facts keyword, set as play keywords.
2 years ago
Abhijeet Kasurde 52529f0b8e
plugins: remove deprecated features (#82976)
* Remove deprecated REQUIRE_WHITELIST
* Remove deprecated module_blacklist

Fixes: #82947

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Martin Krizek 5f36fc9a46
to_nice_json: document the indent option (#82973)
Specifying indent as an option to `to_nice_json` has been possible in
contrary to what documentation states.

Follow-up to https://github.com/ansible/ansible/pull/82912
2 years ago
Jordan Borean 179bc1dabd
fetch - add error check on calculated dest (#82970)
Add explicit error when the calculated dest path for fetch becomes a
local directory. The existing behaviour will not be checked unlike when
the path did not end with a trailing slash.
2 years ago
Abhijeet Kasurde ea55dddc6a
Remove deprecated 'loader' argument (#82968)
* remove deprecated 'loader' argument from listify_lookup_plugin_terms API

Fixes: #82949

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 208168ee4c
apt: add a note about extraneous quotes in package name (#82960)
* add a note for user to not to include extraneous single or double
  quotes while specifying package name with a specific version.

Fixes: #82763

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay 1c17fe2d53
Drop Python 3.7 support (#82982) 2 years ago
Matt Martz c12d42577e
Remove missed changelog fragments (#82975) 2 years ago
Matt Martz 76fe4e8a71
Bump devel to 2.18.0.dev0 (#82934)
* Bump devel to 2.18.0.dev0

* Add ignores for 2.18 deprecations
2 years ago
Sloane Hertel 85d8673860
Follow up to #82933 - remove platforms from templates (#82961) 2 years ago
Brian Coca 4bc6ffb2aa
Eaiser package mgr overrides (#82629)
Added variable to override auto detection



Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Martz <matt@sivel.net>
2 years ago
Sloane Hertel 4bddbe69d5
Fix traceback inheriting from NetworkConnectionBase and add integration tests (#82954)
Co-authored-by: Jeroen van Bemmel <jvb127@gmail.com>
2 years ago
Sloane Hertel 478e139195
remove nonexistent url from role templates (#82933)
* Remove obsolete v1 link for role platforms from the role templates
* Delete platforms block entirely
2 years ago
Abhijeet Kasurde bcaae4c435
systemd_service: Update docs regarding required_* (#82917)
* Update the documentation regarding required_one_of and required_by
  in systemd_service

Fixes: #82914

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 21a987b8b6
connection: update test coverage for SSH connection plugin (#82916)
* connection: update test coverage for SSH connection plugin

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay 9e08f78bd3
ansible-test - Update base/default containers (#82952) 2 years ago
Matt Clay 31901d23e7
ansible-test - Remove FreeBSD 13.2 (#82951) 2 years ago
Abhijeet Kasurde 8280fbc776
ansible-test - Remove Alpine 3.18 (#82116)
Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Sloane Hertel b3d8cdde5d
fix handling allow_duplicates with the role cache (#82691)
allow_duplicates is not part of the role uniqueness, so the value on the cached role may not match the current role.

* remove the allow_duplicates check from Role.has_run() which operates on the deduplicated role
* check the current role's allow_duplicates value in the strategy

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2 years ago
Brian Coca 8704b9fc29
centralize and complete the internal static vars (#82872)
* centralize and complete the internal static vars

These vars are internal and should not be overridden nor templated
from inventory nor hostvars.
2 years ago
mansoor e3f4fe4fb9
ansible-test - Remove macos/13.2 remote from `ansible-test`
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2 years ago
Brian Coca 5c804cbf6f
ssh docs fixes (#82902) 2 years ago
Brian Coca fde206499d
async support check mode (#82901)
Allow async tasks to run in check mode
Add check_mode support to async_status
Add tests, also for 'hidden' async mode in gather_facts/parallel
2 years ago
Sloane Hertel b639bd1fd4
Allow "role_name : " prefix for notifying handler listen topics (#82854)
* Allow role name prefix for handler task listen topics

For example,

- name: handler name
  debug:
  listen: topic1

can be notified using `topic1`, `role : topic1` if the handler is in a
standalone or collection role, and `ns.col.role: topic1` if the role is
in a collection, the same way handler names work.

changelog

* fix changelog and tests
2 years ago
Abhijeet Kasurde 8fec1575e6
apt: handle options while installing python3-apt (#82913)
* apt: handle options while installing python3-apt

* While installing python3-apt library, honor parameter
  such as install_recommends and dpkg_options

Fixes: #40608

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

* Review changes

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Jon a1b6e3a258
Document sort_keys option in to_nice_json() filter (#82912)
Added by https://github.com/ansible/ansible/pull/52341.
2 years ago
snipfoo 5f4e332e37
Fix condition for unquoting configuration strings from ini files (#82388)
* Add prefix to `origin` when configuration variables come from ini files

Fixes ansible#82387

This change was suggested by @bcoca in
https://github.com/ansible/ansible/pull/82388#discussion_r1424235728 and
https://github.com/ansible/ansible/pull/82388#discussion_r1424249732

When configuration variables come from an ini file, their `origin` is
now set to `ini: <file>`. Similarly, once supported, YAML configuration
files will have their `origin` as `yaml: <file>`.

Consequently, since unquoting configuration strings should happen if and
only if they come from an ini file, this condition boils down to testing
whether their `origin` starts with `ini:`.

* Do not add prefix to `origin` but explicitly pass `origin_ftype`

So as not to rely on a specific format of the `origin` string,
as suggested by @sivel in
https://github.com/ansible/ansible/pull/82388#issuecomment-1881714871
2 years ago
Abhijeet Kasurde a870e7d0c6
Bump bundled distro version to 1.8.0 (#81765)
* Bump bundled distro version to 1.8.0

* Bump bundled distro version from to 1.8.0 from 1.6.0

Fixes: #81713

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

* Remove sanity entries

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde d86ad77d6f
Remove deprecated scp_if_ssh from SSH connection plugin (#82072)
* removed deprecated scp_if_ssh feature from SSH connection
  plugin

Fixes: #81715

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde b8b12c4be3
Update sanity requirements (#82296)
* Update sanity requirements
* Drop Python 3.7 for mypy

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay ca168eb367 ansible-test - Fix Alpine libexpat bootstrapping 2 years ago
Brian Coca ad0ec47fe9
first_found lookup; minor fixes (#82836)
Always process options no matter the combination
return a full normalized path (symlinks still not followed, should be specific option in future)
2 years ago
Matt Clay b4d67adfda ansible-test - Update distro containers to 7.1.0 2 years ago
Matt Clay a1ad7100df
ansible-test - Handle externally managed Python (#82883)
Remove EXTERNALLY-MANAGED marker in ansible-test managed environments

Additional changes:

- Test the Alpine 3.19 container
- Stop testing Alpine 3.18 container and remote
- Add missing changelog entry the Alpine 3.19 container
2 years ago
Abhijeet Kasurde 73701004b0
ansible-test - Add alpine 3.19 (#82115) 2 years ago
Felix Fontein c0821346fc
Do not mangle plugin names in collections that start with an underscore. (#82574) 2 years ago
Felix Fontein 11d69e065f
ansible-doc: restore role attributes (#82678)
* Restore role attributes.

* Add a deprecation warning for role argument specs containing attributes

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2 years ago
Matt Clay 31bbc8334e Update container test cgroup handling
When the host uses cgroup v2 and does not use systemd,
skip container scenarios which are unsupported.
2 years ago
Matt Clay a192193c55 Limit Alpine 3.18 test hacks to that version 2 years ago
Brian Coca ddae41759c
Add FreeBSD 13.3 and 14.0 to ansible-test (#82530)
Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Abhijeet Kasurde 8eabeefa63 mypy: update code required to bump sanity requirements
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde aecffcb896 pylint: update for use-yield-from
* With Pylint 3.1.0, use-yield-from check is enabled

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 481d8bdc1e
Unarchive get zipinfo on more OS/distros (#82873)
Not all implementations use -l as default for -Z on unzip
2 years ago
Matt Clay 2b1a5dd7a0 Remove outdated constraint for paramiko setup 2 years ago
Felix Fontein e659c23bf2
blockinfile: do not crash when filename has no path (#81638)
* Do not crash when filename has no path.

* Clean up file after test.
2 years ago
Felix Fontein 0c9f1989a7 Do not treat leading underscore in plugin names as attempted deprecation. 2 years ago
Jordan Borean 8aecd1f9b2
winrm - Handle task timeout (#82784)
When using winrm over HTTP with message encryption enabled and a task
has timed out the connection plugin will fail to cleanup the WinRM
command. This will change that exception into a warning as a timeout is
already an exception event and a failure to clean the operation should
not override the timeout error shown.
2 years ago
Jordan Borean c9086061ca
Allow check mode async task disabling check_mode (#82827)
* Allow check mode async task disabling check_mode

Allows running an async task with check_mode: False when the playbook is
being run in check mode.

* Add check_mode attribute to internal cleanup task
2 years ago
Abhijeet Kasurde 56fa630e47
apt: Install recommended packages while installing deb files (#82805)
* install recommended packages while installing deb files and
  install_recommends is set to true.

Fixes: #29726

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
René Moser c5557ad872
fix wording in error msg (#82848) 2 years ago
Jordan Borean 25c0dc50a2
Fix up to_datetime timedelta seconds docs (#82826) 2 years ago
neofright 732df49e46
Update zip.yml (#82840)
Fix typo of mydcit instead of mydict.
2 years ago
Sloane Hertel 2bb09bfd12
atomic_move - fix preserving extended acls (#82818)
* use copystat to copy as many attributes as possible before os.rename

update unit test mocks for updated method of attribute preservation

add integration test for lineinfile case

remove erroneous `- meta: end_play` from lineinfile test suite

* add keep_dest_attrs parameter to control whether src attributes are
copied initially, and for existing destinations, whether the src is
updated using the dest before being renamed

consolidate with copy unsetting extended attrs

ci_complete
2 years ago
Sloane Hertel 7adc146e2f
Fix traceback and allow installing roles with version None (#81849)
* Allow installing roles with version `None` from Galaxy

Co-authored-by: Matt Martz <matt@sivel.net>
2 years ago
sedrubal 4000656849
git: Rename option gpg_whitelist to gpg_allowlist (#82377)
Signed-off-by: Sebastian Endres <sebastian.endres@dlr.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
tobixx 3b823d908e
Enable file cache for vaulted host_vars_files vars plugin (#81995)
Enable file cache for vaulted host_vars_files vars plugin

* fixes #81994
* Changed cache arg from bool to str to allow 'vaulted' only file cache
* removed unused used var
---------
Co-authored-by: Steffen Oschatz <so@ypsilon.net>
2 years ago
Andrew Klychkov 92df664806
[DOCS] README: update working groups link (#82254) 2 years ago
Abhijeet Kasurde 6439627ce4
test_apt: migrate from unittest to pytest (#82666)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 2806758793
filter: Misc fixes in docs (#82823)
* misc fixes for the filter documentation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 1181436d54
docs: describe capture references (#82819)
* update docs and example for capture references

Fixes: #82797

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Rudnei Bertol Junior 9a0a5d834e
Fixes permission for cache json file from 600 to 644 (#82761)
Until ansible-core 2.12 the facts cache file created by this module, have permission set as 644 which allows the other users to read the cache, since ansible-core 2.13, we create the temporary file, but we do not set the permission after renaming the temporary file.  Adding the line to set the permission to allow other users/groups to read this file.
2 years ago
Matt Martz 86f48a526a
Install crun from Alpine 3.19 for known musl compatibility (#82812) 2 years ago
Abhijeet Kasurde d9e798b48f
debconf: allow a list for value when vtype is multiselect (#82757)
* allow user to specify a list for value when vtype is multiselect

Fixes: #81345

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
0x546f6d-W f02081b391
Fix discrepancy in behaviour between apt-get clean and its equivalent ansible.builtin.apt: clean=True (#82800)
* added integration test for issue 82611 regarding discrepency between apt-get clean and ansible.builtin.apt: clean

* fixed new line issue

* Implementation of bug fix for 82611

Fixed discrepancy in behaviour between apt-get clean and its equivalent ansible.builtin.apt: clean=True

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

---------

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2 years ago
Jordan Borean 936e757478
Document no until support for meta (#82795) 2 years ago
carrychair 8b0f2ad9c5
remove repetitive words (#82799)
Signed-off-by: carrychair <linghuchong404@gmail.com>
2 years ago
Martin Krizek f1ded0f417
dnf: utilize the API for the installed checks (#82725)
Fixes #71808
Fixes #76463
Fixes #81018
2 years ago
Martin Krizek a28709f92d
dnf: fix installing a package based the file it provides (#82744)
Fixes #82461
2 years ago
Matt Martz e0c91af45f
Remove os.environ compat for py2 and deprecate ansible.utils.py3compat (#82794) 2 years ago
Sviatoslav Sydorenko (Святослав Сидоренко) 5d15af3a95
Split the unified PR template into few (#82734)
Ref: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository
2 years ago
Thomas W 6db7a3bd64
Fix handling of ansible_loop_var and ansible_index_var inside ansible.builtin.include_tasks (#82789)
* added integration test for issue 82655 regarding ansible_loop_var and ansible_index_var inside included yml

* ensure correct handling of ansible_loop_var and ansible_index_var inside ansible builtin include_tasks Co-authored-by: Matt <matt@sivel.net>

* added changelog

* fixed new line issue
2 years ago
Abhijeet Kasurde 2cf52daa03
Handle error raised when argument validation (#82783)
* Handle error raised when argument validation with elements=int
  and value is not within choices

Fixes: #82776

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Jordan Borean bb030db546
Re-enable psrp tests that were disabled (#82785) 2 years ago
Jordan Borean 942424e10b
Avoid winrm hang on stdin write failure (#82766)
If the connection plugin fails to write the data to run to stdin we will
only attempt to get the output with one operation attempt. If this times
out we will consider the command to have failed and raise an exception
instead of forever attempting to get the output.
2 years ago
Abhijeet Kasurde dd44449b6e
Use of constant for 644 permission variable (#82762)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde cdd303101e
Follow fix for test_iptables (#82768)
* rename 'test_policy_table' to 'test_policy_table_flush' to remove duplicate
  test case name.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Orion Poplawski 38006103dc
Fixed typo 'must by' to 'must be' (#82769) 2 years ago
Abhijeet Kasurde 8750a1f9ac
test: migrate iptables tests from unittests to pytest (#82647)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Remi Rampin ca2de9e2a4
Improve documentation for replace module (#82756) 2 years ago
Abhijeet Kasurde 03246dc0ae
galaxy: Skip verification for unwanted files (#82162)
Fixes: #81628

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
tikfj 4edd6ba04f
Add MIRACLE LINUX as RedHat OS Family (#82722)
Co-authored-by: Taiki Fujiwara <taiki.fujiwara@miraclelinux>
2 years ago
Martin Krizek 77ab7afc3d
dnf: obey the keepcache setting (#82735)
Fixes #81954
2 years ago
Matt Martz 9a8be1e8c8
Disable ansible-test podman container tests on Ubuntu 22.04 (#82748) 2 years ago
Davide Sbetti 79ea21a39f
Fix error when templating an unsafe string leading to a type error in Python (#82675)
Fixes #82600
2 years ago
Jordan Borean 1b209d742e
Galaxy trailing slash (#82732)
* fix: ensure path argument doesn't have a backslash

* feat: add changelog

* Update lib/ansible/cli/__init__.py

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

* Simplify logic and add tests

---------

Co-authored-by: dorkamotorka <teo.podobnik1234@gmail.com>
Co-authored-by: Teodor Janez Podobnik <48418580+dorkamotorka@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Clay a1edb61ce7
ansible-test - Add work-around for pytest>=8 errors (#82723)
* ansible-test - Add work-around for pytest>=8 errors
* Update changelogs/fragments/ansible-test-pytest-8.yml

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2 years ago
Sviatoslav Sydorenko (Святослав Сидоренко) 386edc666e
Add macOS 14.3 to CI and `ansible-test`
Additionally, this patch takes care of installing GPG within the
`ansible-galaxy-collection` test when running under macOS 14 and higher.

PR #82697

ci_complete
2 years ago
Matt Martz 437457e6d9
Proxy more display methods (#81900) 2 years ago
Matt Martz 5566a655ae
Updates to interpreter discovery for 2.17 (#82420) 2 years ago
Sloane Hertel 4bcc27ca99
add --extra-vars for ansible-galaxy role|collection init (#82605)
allow extra vars when templating j2 files in the skeleton, for example:

ansible-galaxy init --role-skeleton /path/to/skeleton --extra-vars @/path/to/vars_file.yml newrole

ansible-galaxy init --extra-vars "min_ansible_version=2.17.0" newrole
2 years ago
Ikko Eltociear Ashimine b88d43a029
uri: update use_netrc.yml (#82672)
Changed successfull to successful
2 years ago
Matt Martz 6c21c545e1
Deprecate support for the v2 galaxy API (#82543)
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2 years ago
Matt Davis d15b77b94e fix find integration test
* original test assertion was not quoted properly and was thus silently "truthy" instead of actually functioning
2 years ago
Abhijeet Kasurde a23ea2aef2
Reword warning if the reserved keyword `_ansible_` is used (#82657)
Extend the wordings in warning if the reserved keyword _ansible_
is used as a module parameter.

Fixes: #82514

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2 years ago
Matt Clay c8d6f7b95e ansible-test - Fix validate-modules Python handling
The ``validate-modules`` sanity test no longer attempts to process files with unrecognized extensions as Python.

Integration tests have been added to verify Python-specific checks do not apply to these files.

The `invalid-extension` and `missing-gplv3-license` checks still apply to these files. This may change in the future.
2 years ago
Abhijeet Kasurde e78be30baa
apt_repository: Update PPA URL to point to HTTPS (#82599)
Fixes: #82463

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
wolfwork b6a89bff6c
Add missing char 's' in exists documentation (#82651) 2 years ago
Matt Martz 11efa5c48b
Reduce complexity of Request.open (#81988) 2 years ago
David Shrewsbury eb44c77968
Remove tests for ansible-runner (#82571) 2 years ago
Sloane Hertel a452c53375
import_role - allow subdirectories with _from options (#82642)
* Allow subdirectories with import_role _from options

Add tests that tasks_from is restricted to the role

Note that a task like:

- import_role:
    name: role
    tasks_from: tasks/entrypoint.yml

will now load tasks from "{{ role_path }}/tasks/tasks/entrypoint.yml"
instead of "{{ role_path }}/tasks/entrypoint.yml". This change in
behavior matches include_role.

* better test case (filename doesn't match one in tasks/)

Fixes #82584
2 years ago
Abhijeet Kasurde da26e2a5eb
iptables: added choices in match_set_flags option (#82641)
* 'src,src', 'dst,dst' added as new option choices in
  match_set_flags option

Fixes: #81281

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Martin Krizek a10d255e0b
dnf,dnf5 - add the best option and fix nobest (#82627)
best/nobest options are one of the options whose default values are set
by an OS distribution. For example in our CI, both Fedora and RHEL set
the best option to different default values. As such we should defer to
the distributions for the default value and not change it by default but
if users wish to change it they can do so explicitly.

Currently the dnf module sets the nobest option inconsistenly and not for
all cases. This patch fixes that to reflect the behavior described
above. In addition adding the best option for both dnf and dnf5 modules
since the best option is prefer to nobest in dnf while in dnf5 nobest is
completely removed in favor of best.

Fixes #82616
2 years ago
Matt Martz e458cbac61
Allow for arbitrary key 'context' in argument spec (#82183)
* Allow for arbitrary key 'context' in argument spec
2 years ago
Abhijeet Kasurde 7a0c321054
Remove redundant undefined error message (#81867)
Fixes: #78703

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca bec27fb4c0
prettyfy ansible-doc (#75116)
* prettify ansibile-doc output

delimiters when no color
avoid triggering color mode for existing tests
all use _format to observe nocolor
more v more info
imporoved conditional display
updated version on -v
normalize role errors
expand role data, dedupe code, fix formatting on warning
fix bug with galaxy info
role list improvements:
 lists all roles (even w/o meta/argspec)
 specs now indented under role
 role only listed once
Updated tests to reflect format changes

Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Martin Krizek 6d34eb88d9
Do not ignore SyntaxError from jinja2.Environment.from_string (#82607)
Jinja may generate an invalid Python source code from a template. Trying
to compile such source code into a Python code object results in
SyntaxError being thrown. An example of such a template is providing the
same keyword argument into a lookup twice, resulting in:
`SyntaxError: keyword argument repeated`.

Since `jinja2.exceptions.TemplateSyntaxError` does not cover such a
case, as it is not a Jinja parsing error, we need to catch SyntaxError
explicitly ourselves.

Fixes #82606
2 years ago
Sloane Hertel 13e6d8487a
fix loading vars_plugins in roles (#82273)
* Fix loading legacy vars plugins when the plugin loader cache is reset

* Remove extra cache layer by ensuring vars plugin names are cached (stateless or not) so that the plugin loader cache can double as the load order
2 years ago
Steffen Scheib 8641144375
Adding note about implicit groups (#82580)
clarifying usage in conjunction with use_group_vars
2 years ago
Brian Coca 8b2dd5fdd3
updated looups to use set_option in custom parse (#82425)
limit password params
  updated test error message catching
  make sure we reset params for each term
  ensure we only update options if we have em
2 years ago
Abhijeet Kasurde f73d72e830
find: do not fail on PermissionError (#82282)
* Log and skip permission errors on files and directories

Fixes: #82027

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Martin Krizek f024cf35d7
Remove the yum module, redirect it to dnf (#81895)
Fixes #81728
2 years ago
Yacht Shaver c7334ea92c
Fix url encoded credentials in netloc (#82552)
Prior to this commit, it was impossible to use a module like dnf with a
URL that contains a username with an @ such as an email address
username, because:

  dnf:
    name: https://foo@example.com:bar@example.com/some.rpm

Would cause netloc parsing to fail. However, the following:

  dnf:
    name: https://foo%40example.com:bar@example.com/some.rpm

Would also fail because ansible would *not* URL-decode the credentials,
causing the following to be base64 encoded in the Authorization header:

  Zm9vJTQwZXhhbXBsZS5jb206YmFyCg==

Which decodes to:

  foo%40example.com:foo

Which is *not* the authorized username, and as such, *won't* pass basic
auth.

With this commit, Ansible's url lib behaves like curl, chromium, wget,
etc, and encodes the above to:

  Zm9vQGV4YW1wbGUuY29tOmJhcgo=

Which decodes to:

  foo@example.com:bar

Which will actually pass the HTTP Basic Auth, and is the same behaviour
that you will find ie. with:

  curl -vvI https://foo%40bar:test@example.com 2>&1 |grep Auth | awk '{ print $4 }'
2 years ago
Martin Krizek 06cd285901
Play recap stats and callbacks for include_role, consolidate with include_tasks (#79260)
This moves handling of callbacks and play recap stats from
_load_included_file to individual strategies so include_role tasks are
accounted for, not just include_tasks.

Fixes #77336
2 years ago
Mike Bonnet 9c5d3060e5
uri: Handle the "force" parameter properly (#82187)
* uri: Two tests that demonstrate missing handling of the "force" parameter

Add unit and integration tests that demonstrate that the uri module is not
handling the "force" parameter.

The unit test demonstrates that when "force" is present in the module parameters,
it is not being passed through to fetch_url().

The integration test demonstrates that "force" does not disable caching as
documented, and calls with a "dest" parameter that points to an existing file
can result in a "304 Not Modified" response.

* uri: Handle the "force" parameter properly

The uri module documents a "force" parameter that can be used to disable caching.
The module accepted the parameter but didn't pass it through to the fetch_url() method
which implements the logic to handle setting the appropriate headers for disabling
caching. This change passes the "force" parameter through as expected, allowing caching
to be disabled when requested by the module caller.
2 years ago
ShIRannx aa40167f40
find - add encoding option to use in conjunction with contains (#82284)
*  when doing a 'contains' search, determine the encoding of the files to be searched

* set default encoding to None for backwards compatibility

* changelog, error handling, tests added

* add sanity ignore.txt for non-utf-8 test
2 years ago
Nilashish Chakraborty b01f1f207c
Support `action_plugin` in plugin_routing_schema (#82562)
now validation schema matches reality

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Martin Krizek 853423c270
test_encrypt: remove unreachable assertion (#82570)
We explicitly skip tests in environments where passlib is not available.
2 years ago
Sviatoslav Sydorenko (Святослав Сидоренко) a3e5546e43
🔥 Exterminate `__builtin__` import from tests (#82569)
This patch removes an import fallback that was only executed under
Python 2. Now that we don't run tests against that runtime, it
generates an uncovered line. Dropping it will slightly increase the
coverage metric as a side effect.
2 years ago
Matt Martz 6935c8e303
Ensure ANSIBLE_NO_LOG is respected (CVE-2024-0690) (#82565) 2 years ago
tachyontec 48bed1e15a
Fix ansible.builtin.include_vars - depth (#80995)
* Changes as suggested by sivel

* Add changelog fragment and tests

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Martin Krizek 3f74bc08ce
Remove crypt support from ansible.utils.encrypt (#81721)
Fixes #81717

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Clay 71d81e4a60
Add no-unwanted-characters sanity test for core (#82557) 2 years ago
Matt Clay 30169c76de Replace Unicode no-break spaces with ASCII spaces 2 years ago
Matt Davis 4aa109897f
default svn URL to 127.0.0.1 for subversion integration tests (#82551)
* default svn URL to 127.0.0.1 for subversion integration tests

* svn client gives up before trying IPv4 addresses when localhost->(::1,127.0.0.1) in dual-stack envs (eg podman, most real hosts)
* svn client also requires legacy CN match on cert
* IPv6 works, but setup playbook would need a bunch more templating exceptions to conditionally manage `[::1]`

* explain IPv4 defaults
2 years ago
Martin Krizek d9709c5ae9
module_utils/basic.py: remove PY2 compat (#81989) 2 years ago
Martin Krizek 975cf1655a
modules: remove PY2 compat (#81990) 2 years ago
Mark Goddard 4a2de764ec
Fix issues with ansible-playbook-callbacks test (#82407)
The timing of the async tasks was a little unpredictable, meaning that
sometimes we would get an unexpected number of v2_runner_on_async_poll
callbacks, and fail the test. This change fixes the issue by increasing
the poll interval to 2 seconds and the sleep duration to 3 seconds, such
that on a reasonably responsive system we will poll twice per task, with
the sleep ending in the middle of the two polls.

The include_me.yml file does not exist in this integration test. It has
been added.

The remote_tmp_dir.path expression is invalid - the setup_remote_tmp_dir
role uses set_fact to set remote_tmp_dir to remote_tmp_dir.path.

The integration tests run with ANSIBLE_HOST_PATTERN_MISMATCH=error,
meaning that the final play was never reached. Set
ANSIBLE_HOST_PATTERN_MISMATCH=warning to continue past the play and
trigger the v2_playbook_on_no_hosts_matched callback.
2 years ago
Matt Clay 5f1b3898e8
Avoid delattr in test callback plugin (#82550)
This prevents the test plugin from tampering with the base callback plugin,
which causes issues with all other callback plugins running in the test.
2 years ago
Brian Coca b8c7ed39e4
Reboot timeout fix (#82526)
reboot now uses fallback as some plugins or older versions on ssh one use 'timeout' instead of 'connect_timeout'
2 years ago
Sloane Hertel 0429520790
expect docs - improve responses description (#82544)
* consolidate notes describing the structure of `responses` with the option description

* include a link to Python regex syntax
2 years ago
Samadou OURO-AGOROUKO 6b9f49b6c5
Update attribute description for check_mode (#82536)
Fixes #82509
2 years ago
Akira Yokochi bf9509bf33
validate_argument_spec: fixed example syntax (#82534) 2 years ago
Matt Clay 21247c828e ansible-test - Bypass PEP 668 checks
When ansible-test installs requirements, it now instructs pip to allow installs on externally managed environments as defined by PEP 668.

This only occurs in ephemeral environments managed by ansible-test, such as containers,
or when the `--requirements` option is used.
2 years ago
Sloane Hertel da9edd7760
expect - fix argument spec error with timeout=null (#82522)
* Fix using timeout=null to wait indefinitely

* fix error message
2 years ago
Sloane Hertel d7be3824fe
[ansible-galaxy] Remove role name conversion when the repo startswith 'ansible-role' (#82508)
* Remove role name conversion based on whether the repo name starts with
ansible-role

This was added in 2.3 to match the Galaxy ui behavior of truncating the
'ansible-role-' prefix automatically, but the new backend requires an
alternate name to be provided or defined in the ``galaxy_info``
metadata.

Roles that were imported using the ansible-role-$name convention will
need to use ``--role-name`` or add ``role_name`` to the ``galaxy_info``
dictionary in ``meta/main.yml``.

changelog

* Update changelogs/fragments/fix-default-ansible-galaxy-role-import-name.yml

* Update changelogs/fragments/fix-default-ansible-galaxy-role-import-name.yml

Co-authored-by: flowerysong <junk+github@flowerysong.com>

---------

Co-authored-by: flowerysong <junk+github@flowerysong.com>
2 years ago
Alicia Cozine d2812aeb6f
Update example in apt module docs (#82504)
All examples should use fully qualified collection names to avoid confusion.
2 years ago
Abhijeet Kasurde a69fab86bc ansible-test - remove Fedora 38 container and remote support
Fixes: #82022

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay 78c9090986 Don't hard-code Alpine version in container test 2 years ago
Sloane Hertel 4760dae989
document apt auto-installed dep (#82503) 2 years ago
Brian Coca 596c75c2bc
uri action plugin check_mode support update (#82484)
Also updated base action messages to be more specific
2 years ago
Brian Coca 6c2895fd88
ansible-config dedupe ini plugin entries (#82498)
added test for ini file integrity, also ensuring no dupes
2 years ago
Harshvardhan Sharma 623e0eee42
Add Alp-Dolomite to Suse family list (#82496) 2 years ago
Abhijeet Kasurde 53ddc1648e
deb822_repository: handle idempotency (#82483)
* deb822_repository: handle idempotency

Sort the parameters in order to handle idempotency

Fixes: #82454

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 57a59e7194
Misc fix (#82482)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde ceaf68a02c
Deprecate `required` param in get_bin_path (#82466)
* Deprecate `required` param in get_bin_path

* The parameter `required` in process.get_bin_path API
  is deprecated. Will be removed in 2.21

Fixes: #82464


Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Felix Fontein 6c647aa263
Interpret double newlines as paragraph breaks in documentation strings. (#82465) 2 years ago
Yinchuan Song 0a45dad884
Add VMware virt detection for hardware version of ESXi 8.0. (#82455)
* Add VMware virt detection for hardware version of ESXi 8.0.

* Add changelog for PR#82455
2 years ago
Sloane Hertel caa86cc4df
Add the task info for tombstoned module/action plugins (#82451)
* Add the task info for tombstoned plugins

* Fix deprecation for 'include' by removing it from BUILTIN_TASKS which skip the plugin loader lookup

* changelog

remove obsolete unit test using 'include'

* Update changelogs/fragments/improve-tombstone-error.yml
2 years ago
Sloane Hertel b5649f9686
Remove more Python 2 handling from tests (#82449) 2 years ago
Matt Clay 71a5212586 Add skips for encrypt unit tests for Python 3.13 2 years ago
Brian Coca 6e4a5acfbd
lineinfile, remove incorrect/unused 'others' option (#82436)
* move incorrect, unused 'others' option

 this was to document 'file' options are usable .. but we already
 import the file fragment to document those options.

* removed now bad ignore
2 years ago
Alicia Cozine 8762d9e7e6
Adds details to the password_hash documentation (#82419)
fix for issue 82415

-

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Matt Clay c75624fbdc ansible-test - Enable shellcheck SC2164 2 years ago
Matt Clay 3c432fea43 ansible-test - Update base/default test containers 2 years ago
Matt Clay a1958eefed Fix plugin_loader integration test error handling 2 years ago
Matt Clay 630e5dda25 Clean up shellcheck issues in tests 2 years ago
Matt Clay e1bcb8a534 Remove unused unit test code 2 years ago
Brian Coca 29b2405b84
Revert "Fix older external connection plugins without _sub_plugin declaration (#79372)" (#82473)
This reverts commit ef1e01aa8b.

broken tests
2 years ago
J vanBemmel ef1e01aa8b
Fix older external connection plugins without _sub_plugin declaration (#79372)
fixes https://github.com/ansible/ansible/issues/79371

* Check for sub=={} too
* Add a test case for older plugins that do not define '_sub_plugin'
* Add test for legacy plugins
2 years ago
Brian Coca 55065c0042
Role fixes (#82339)
* Various fixes to roles

  - static property is now properly set
  - role_names and other magic vars now have full list
  - role public/private var loading is now done when adding to play.roles instead of on each var query
  - added tests

Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Abhijeet Kasurde fa92228b50
Replace unwelcoming words (#82413)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 4479c9df13
Fix plugin set option (#82300)
* plugin config, ensure set_option correctly casts

  until now we relied on plugin author getting the right type, now
  the config system itself will process as it would for set_options
2 years ago
Mark Chappell 5346009d2c
ansible-test - Allow multiple documents in the YAML stream for EXAMPLES (#82355)
* Allow multiple documents in the YAML stream for EXAMPLES.

* Add integration test

* linting
2 years ago
snipfoo 8328153121
Run all handlers with the same `listen` topic when notified from another handler (#82364)
Fixes #82363
2 years ago
Sloane Hertel fe81164fe5
ansible-galaxy - fix exit code for failed role import (#82193) 2 years ago
Abhijeet Kasurde 7f2ad7eea6
assemble: fixed missing parameter error (#82360)
* content is an optional parameter for _get_diff_data API

Fixes: #82359

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca a9919dd7f6
lookups, make file searching use better is_role (#82290)
* lookups, make file searching use better is_role

 The dwim function will internally try by detecting tasks/main['','.yml','.yaml]
 but this is far from optimial, the existince of role path in vars is much better
 indicator that we can use to pass a hint


* updated test to avoid main.yml
2 years ago
Brian Coca 5573d4cde9
Scripts inventory plugin, add examples (#82361)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Lukas Heffner 8af920c892
Add helptext to ansible-inventory's positional arg (#82332)
* Add helptext to ansible-inventory's positional arg

This explanation is already present in the documentation and
should make the usage more clear when looking at the --help output

* fix indentation

* change description of positional arg

It has no effect on --list and the docs now reflect that
2 years ago
Danny Luwel 9b002d2e63
check if there attributes to set (#78707)
Fixes: #76727
2 years ago
Sviatoslav Sydorenko dd0138ba21
🧪 Replace GitHub SVN integration test with local TLS (#82334)
* Run svn integration test locally with TLS

This patch uses a `trustme` to make an ephemeral CA, and server, and
client TLS artifacts for testing. These are integrated into the Apache
web server via it's `mod_ssl`.

Resolves #82207

* Replace GitHub SVN HTTPS URL w/ localhost over TLS

This change gets rid of the need to use GitHub, which is just about to
drop support for SVN [[1]]. Moreover, it eliminates the need to use
external network for any SVN commands in the test.

[1]: https://github.blog/2023-01-20-sunsetting-subversion-support/
2 years ago
Brian Coca 6ebefaceb6
Better errors for delegate_to (#82319)
Handle empty result of templating
  Also skip work when we omit
2 years ago
Sloane Hertel 3a42a00368
Targeted fix for installing roles with symlinks containing '..' (#82165)
Set the tarfile attribute to a normalized value from unfrackpath instead
of validating path parts and omiting potentially invald parts

Allow tarfile paths/links containing '..', '$', '~' as long as the
normalized realpath is in the tarfile's role directory
2 years ago
Yigithan Kadir BALCI b405958f79
fixes typo in cli/ansible-pull arguments (#82316) 2 years ago
Brian Coca 1dd0d6fad7
remote log info (#81711)
Both posix and powershell avenues updated to allow for customized string logging on remote

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2 years ago
Matt Clay 4208bdbbcd ansible-test - Update nios-test-container to 3.0.0 2 years ago
Jan-Piet Mens ee86dafc6e
Amend doc of name= parameter to indicate a list of packages can be used (#82309)
* Amend doc of name= parameter to indicate a list of packages can be used

One of the examples here shows package installing a list of packages, but the name= parameter did not reflect this possibility.

* add dependency to underlying package manager
2 years ago
Brian Coca e80507af32
fact_gathering improve linux thread counts (#82261)
don't use `//` aka `floor()` as some architectures show counts of 1.9 threads per CPU and market as 2 per CPU, `round()` will be closer to that.
2 years ago
Martin Krizek fd2d0ecfb7
Remove unneeded Task.is_static assignment (#82288)
Added in b38f746 but there is/was no Task.is_static so this just creates
a new attribute dynamically that is/was never used.
2 years ago
Suryakiran Sureshkumar 322eb0f884
changed the salt type from int to string (#82274) 2 years ago
Abhijeet Kasurde 265f5e724c
apt_repository: Do not convert symlink repo to a normal file (#82271)
* apt_repository: Do not convert symlink repo to a normal file

* module manually writes to repo files. If the file is a symlink
  module used to re-write and convert a symlink to a normal file.
  This fix tracks the symlink and keeps the changes intact.

Fixes: #49809

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde e6e19e37f7
validate-modules: Check for correct values in choice (#82266)
* validate-modules: Check for correct values in choice

* validate-modules test now checks the length of choices and
  correct option values inside the choice.

Fixes: #82179

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

* Fix sanity tests

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Greg "Gwmngilfen" Sutcliffe 0806da55b1
Add DCO and update CONTRIBUTING.md (#82105) 2 years ago
Felix Fontein 479949aad2
Fix broken docs RST reference. (#82286) 2 years ago
Martin Krizek afd45aca6a
ansible-test - remove rhel 9.2 test remote (#82211)
Fixes #82024
2 years ago
Sebbo94BY e0bf76e3db
Issue #80267: Remove user not found warning (#80291)
Co-authored-by: Sebi94nbg <sebastian.kraetzig@4g-server.eu>
2 years ago
Martin Krizek d664f13b4a
Allow include_tasks handlers for searching role subdirs (#82248)
Fixes #82241
2 years ago
Chris Francy a4b00793be
Update known_hosts module to better handle @cert-authority keys (#70340)
Signed-off-by: Chris Francy <zoredache@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Gods 7dde4901d4
unarchive: support 8 character permission strings (#81705) 2 years ago
Abhijeet Kasurde ce9d268ab8
unarchive: force unarchive if the symlink target changes (#82253)
Fixes: #30420

Original PR from nrwahl2 (https://github.com/ansible/ansible/pull/30463)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Herman van Rink d6a8df3218
csvfile - add a keycol parameter to specify in which column to search. (#82242) 2 years ago
azrdev 0a6779f6b7
docs: improve readability & scope of docs for ansible.builtin.assert (#82256)
Co-authored-by: Jonathan Biegert <jonathan.biegert@sva.de>
2 years ago
Martin Krizek c35e0e8fd8
Re-enable "group removal" integration test for dnf5 (#82250)
Fixed in https://github.com/rpm-software-management/dnf5/pull/1013
2 years ago
Abhijeet Kasurde fbdb666411
ansible-test: Added Fedora 39 (#82218)
* Fedora 39 remote
* Fedora 39 container

Fixes: #82018

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 8fd1aa0d2e
syslog: Handle ValueError raised while sending logs to syslog (#82225)
* ValueError exception is raised when Null Character is sent
  to syslog.syslog with Python 3.12.
* Handle this error gracefully instead of stacktrace

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde 1a759659fe
Enable vendored copy of distutils in entry_point test (#82232)
* Enable use of vendored copy of distutils by removing
  the environment variable SETUPTOOLS_USE_DISTUTILS

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 8b102dca4a
wait_for, fallback to read for non mmapable files (#82064)
* also handle oserror, added debug jic
2 years ago
Brian Coca f6d7dd0840
displaly. log, handle when caplevel is already taken care of (#82227)
reneables ansible logging
2 years ago
Abhijeet Kasurde f8cdec6324
ansible-test: Downgrade containerd for Fedora 39 (#82231)
* containerd 1.6.23 on Fedora 39 causes issue. Downgrading
  to containered to 1.6.19-2 works.
* See: https://bugzilla.redhat.com/show_bug.cgi?id=2237396

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde a45dc10b8f
ansible-test: Skip modularity test for Fedora 39 and up (#82230)
* Modularity is deprecated in Fedora 39 and onwards,
  Skip modularity tests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 6e448edc63
no_log avoid masking booleans (#82217)
* no_log avoid masking booleans

* clog

* fix issues
2 years ago
Matt Martz f42984eeb3
Fix ManifestControl dataclass to work with future annotations (#82215)
* Fix ManifestControl dataclass to work with future annotations

* Add tests
2 years ago
Brian Coca 3d9e5c8b9d
fix pc misuse (#82157)
use the more up to date 'task' as play_context only has the 'initial' values.
2 years ago
Brian Coca e2d108db2b
log verbosity (#81692)
Allow users to adjust verbosity to logs at same or higher level than to callback/screen

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Aditya Putta dbddabce9e
Create prefix of file using ansible.builtin.tempfile (#82209)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 8825e60add
ansible-pull: expand destinantion directoy to avoid purgin in / (#82030)
* expand destinantion directoy to avoid purgin in /

  bad things could happen and help alone is not enough
2 years ago
Aditya Putta 05259aa6ce
Restart a Service with Sleep Between Stop and Start (#82210)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Martin Krizek 0bab08ee33
ansible-test - Add RHEL 9.3 support (#82178)
Fixes #82020
2 years ago
Brian Coca 2277d470b3
fix typo (#82202) 2 years ago
Brian Coca 4a84a9b3db
copy keep suffix on temp file for validation (#82158)
Also updated test to require suffix

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Martin Krizek a8b6ef7e7c
flush_handlers: handle a failure in a nested block with force_handlers (#81572)
Fixes #81532

ci_complete
2 years ago
Ikko Eltociear Ashimine 9c09ed7392
Fix typo in validation.py (#82195)
covert -> convert
2 years ago
Tom Downes 667526c22f
Fix two misspellings of occurred (#82159) 2 years ago
Dellucifer f2b5c33349
fixed typos in the documentation (#82077) 2 years ago
Matt Clay fd009a073a Remove sefcontext support plugin
It was only used by the subversion test, but is no longer required.
2 years ago
Matt Clay 0e6942a4d7
Remove unused unit test code (#82168) 2 years ago
Abhijeet Kasurde c5b68ef16d Update Python3
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay 98407fc00e Remove unused validate-modules unit test code 2 years ago
Matt Clay dae4e2f07f
Remove unused/unreachable unit test code (#82160) 2 years ago
Matt Clay 0be33551d7
Remove unit tests dependent on systemd bindings (#82161)
These do no not run as part of our test suite.
2 years ago
Abhijeet Kasurde 78c16d983e Remove type_regex testcase
This is leftover testcase for type checker regex removed in
https://github.com/ansible/ansible/pull/82153

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay 9dd3eafa14 ansible-test - Use pylint unidiomatic-typecheck
This replaces the regex based check previously used within the validate-modules sanity test.

NOTE: The pylint check overlaps with a similar check for pep8.
      Both are used, since the pep8 based check is more nuanced than the one in pylint.
      For example, allowing `is` checks, but not `==` comparisons.
      If the pylint check is ignored, the pep8 check would still be relevant.
2 years ago
Maxwell G 78546382b3
setup.cfg: add `Programming Language :: Python :: 3.12` classifier (#82151)
ansible-core 2.16+ supports Python 3.12. This corrects missing metadata.
2 years ago
tdltdc d46b042a94
Reword note on default determination on other OSes (#82147) 2 years ago
Abhijeet Kasurde 40baf5eace
iptables - set jump to DSCP when set_dscp_mark or set_dscp_mark_class is set (#82145)
set_dscp_mark and set_dscp_mark_class is only valid when jump is set to
DSCP.

Fixes: #77077

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
A.YOGUN 567c78f9a1
Update playbook responses for specific prompts (#82137)
Example is added for multiple questions with responses
2 years ago
Martin Krizek 7538668731
Check strict before failing to respect skip_broken (#80795)
Fixes #80590
2 years ago
Matt Clay 916a20fccd Ignore coverage of test code that does not run 2 years ago
Matt Clay 90203b841a Use functools.update_wrapper instead of a copy 2 years ago
JustinWayland dec9eeb2e5
Remove create_new_password parameter in CLI.build_vault_ids (#82066)
* Remove unused argument in call to build_vault_ids

* Remove obsolete build_vault_ids tests

* Change tests to account for argument removal

* Remove redundant test
2 years ago
Brian Coca 20a54eb236
restore role param precedence (#82106)
* add test for setfact/param override
2 years ago
Martin Krizek 5ac62473b0
dnf: properly set gpg options on repos (#80777)
Fixes #80110
2 years ago
zpGao 51d691bfa9
remove the obsolete TODO comments (#73116)
Co-authored-by: Zhipeng.Gao <zhipeng.gao@monash.edu>
2 years ago
Matt Clay ac3ae94ae1
Ignore coverage on code intended never to execute (#82128)
* Ignore coverage on code intended never to execute

* Fail collection loader test if wrong code runs

* Update boilerplate test to accommodate nocover
2 years ago
Abhijeet Kasurde 8ecc1d485b
Fix the strategy plugin description in keywords (#82113)
Fixes: https://github.com/ansible/ansible-documentation/issues/762

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay 1df791cd90
Ignore code which coverage can't analyze (#82125)
* Ignore code which coverage can't analyze

Our own tracing function can't be traced.

* Use `nocover` instead of `no cover` for consistency
2 years ago
Jordan Borean f8a9fd4758
Remove duplicate winrm test (#82124) 2 years ago
Matt Clay 36d6860d80 ansible-test - Remove no-main-display sanity test 2 years ago
Matt Clay 6e15fb0ebf ansible-test - Removed no-basestring sanity test 2 years ago
Matt Clay c349b91af3 ansible-test - Removed no-dict-* sanity tests 2 years ago
Matt Clay 9765bb46f9 ansible-test - Remove no-unicode-literals test 2 years ago
Matt Clay 172a010dd7 Remove unused test support plugins 2 years ago
Matt Clay 5b1b0ce762 Remove Python 2 compat (via six) from unit tests 2 years ago
Matt Clay 18e8401edd
Remove Python 2.x compat from unit tests (#82109) 2 years ago
Matt Clay bea459654a pip - Add module in venv example 2 years ago
Matt Clay 89cda0bcae
pip - Add break_system_packages option (#82097) 2 years ago
Matt Davis 3ea5304a57
add pep668 note to pip module docs (#82096) 2 years ago
Baptistech f8de6caeec
Reboot - delete useless parameter async, not supported (#80017)
Co-authored-by: baptch <b.jean.ch@gmail.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2 years ago
Brian Coca 2908a2c32a
corrected become same user config docs (#82059)
fixes #82057
2 years ago
Jordan Borean b34f4a559f
Add support for TLS 1.3 Post Handshake Auth (#82063)
TLS 1.3 adds a different method it can use to request a client
certificate after the handshake but Python does not allow this by
default. This commit sets the attribute needed to enable this scenario
when using client certificates on Python 3.8+, 3.7.1+.
2 years ago
Jordan Borean f5a0c0dfc8
Ignore testing data for gitleaks (#82083) 2 years ago
Arthur Lutz 9b78316687
docs(template): use unambiguous syntax for mode (#82079) 2 years ago
Aditya Putta 664fe45be9
Create a User with a Home Directory (#82078) 2 years ago
Jordan Borean f5d7dc1a97
Legacy.psm1 - Add note telling people not to use function (#82076) 2 years ago
Thomas Sjögren fb8ede22e1
don't warn about using a yescrypt hash as user password (#82071)
* dont warn about using a yescrypt hash as password

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add changelog

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add yescrypt test

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2 years ago
Abhijeet Kasurde e8ef6b7d7c
Consolidate systemd detection logic (#81809)
* Add logic to consider the canary location for systemd files

Fixes: #80975

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca bf29458726
Address nuance in key checking docs (#82058)
* Address nuance in key checking docs

  and add note to ssh plugin to let users know 'final authoritative source'.

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

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Michael Pardatscher b4920c83ad
Fix locale related parsing error in git.py
* Fix locale related parsing error in git.py

This fixes the issue found at https://github.com/ansible/ansible/issues/77213 which got introduced by changing over to "best parseable locale" approach, but missing out the requirement of locales other than `L` having to have `LANGUAGE` specified as well. For further details, check this post within the issue discussion: https://github.com/ansible/ansible/issues/77213#issuecomment-1446919617

* Add changelog

Create 81931-locale-related-parsing-error-git.yml
2 years ago
Martin Krizek fe94a99aa2
any_errors_fatal fixes (#78680)
Fixes #31543
Fixes #36308
Fixes #73246
Fixes #80981
Fixes #81533

ci_complete
2 years ago
Matt Clay c827dc0dab Remove obsolete requirements from prepare_http_tests 2 years ago
Abhijeet Kasurde 0bfc5bcf82
Fix contains example (#82067)
* Added missing round bracket

Fixes: https://github.com/ansible/ansible-documentation/issues/555

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 99e0d25857
ansible-pull now handles all secret files CLI options (#82009)
* ansible-pull added missing pasthrough for secrets

 Both become and connection password file options were missing.
 Also added test
2 years ago
Brian Coca 9ee603d1c5
Clarify some points in config lookup documentation (#81951)
Also update tests to support the format on modules/plugins

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Adam Ross b815b15362
Fix additional spelling errors in builtin modules (#82012) 2 years ago
Matt Clay 0b7387d46c Improve filter_encryption test
- Update `data2_vaulted_string_with_id` to match the documented plaintext.
- Add a comment explaining how `data2_vaulted_string_with_id` was derived.
- Add assertions for unvaulted values to ensure they match their plaintext.
- Add round-trip tests for vault+unvault when no salt is used.
2 years ago
Matt Clay 2d2211e4e1
Simplify filter_encryption test (#82062) 2 years ago
Matt Davis 40263992df
remove args passthru on role runme tests that use grep (#82060)
* varying verbosity was masking some first-pass test failures
2 years ago
Brian Coca b4566c18b3
Fix Jinja plugin deduplication (#82002)
for j2 plugins dedupe on path and  not basename
for j2 this is a container file , for other plugins file name == plugin name
2 years ago
Matt Clay e933d9d8a6 ansible-test - Fix parsing of cgroup entries 2 years ago
Matt Clay 09d943445c
Fix subversion integration test (#82029)
- Remove dependency on the htpasswd module (and thus passlib)
- Fix setup/teardown of the httpd process
- Fix cleanup of temporary directories
2 years ago
Steve Maher 598a9307d7
var names not matching in example. (#82001)
Update to var name as example is not correct.
2 years ago
DomenickD3 2e4f5d5ca0
Replace launchpad.net/api with api.launchpad.net @ apt_repository module
This patch is a refactoring change. It replaces one Launchpad endpoint URL with another on a subdomain. There is no functional effect to this whatsoever.

PR #81978

Refs:
* https://github.com/ansible/ansible/pull/81978#issuecomment-1767062178
* https://bugs.launchpad.net/launchpad/+bug/2039251/comments/12
2 years ago
Matt Clay 37cee8bdfc
ansible-test - Remove special cryptography install (#82008)
Python 3.10 is the minimum version on the controller, and it requires openssl 1.1.1 or later.

As a result, there's no need to check the openssl version any longer.
2 years ago
Deeptanshu Das 74f6e6a134
Update apt.py (#81975)
updating documentation
2 years ago
Jordan Borean 22568305d6
Add ignore invalid options override for mod wrapper (#81899)
Adds an option that can have an action plugin tell the module to ignore
options that do not fit its arg spec. This is to enable support for core
running modules that exist outside of the collection that may not be new
enough to support some of the options supplied to it.
2 years ago
Isaac Chung 5812cabaf5
Fix typos in builtin modules (#81969) 2 years ago
Matt Clay 4f04df75cc
Fix outdated S3 URLs (#81964)
We should always use the CloudFront backed endpoint (ci-files) not the direct S3 bucket reference (ansible-ci-files).
2 years ago
Matt Clay f5c742cdfd
ansible-test - Clean up old Python 2 compat code (#81962)
* Update generated code __future__ import

* Remove Python 2.x compat from compile sanity test

* Remove __metaclass__ from pylint good names list

* Remove Python 2.x compat from ansible-test injector

* Remove Python 2.x compat from ansible-test importer

* Remove Python 2.x compat from ansible-test units

* Remove Python 2.x compat from validate-modules

* Remove Python 2.x compat from pylint plugins

* Remove more Python 2.x compat from ansible-test

* Remove Python 2.x openssl detection in ansible-test

* Remove obsolete Python 2.x comment

* Remove obsolete ansible-test Python 2.x support

* Remove unused bootstrap script functions

* Keep mypy happy

* Remove unused imports

* Keep pylint happy
2 years ago
Matt Clay 3ae8541133
Update boilerplate in galaxy network templates (#81959) 2 years ago
Matt Clay 3f607359de
Remove obsolete compat code from integration tests (#81961)
Also fix up boilerplate for non .py extension files that contain Python code.
2 years ago
Matt Clay 40e4c69724
Cleanup the hacking directory a bit (#81960)
* Clean up hacking/ansible-profile script

Also rename the script so it has a `.py` extension.

* Remove test-module symlink

Use the test-module.py script instead.
2 years ago
Matt Clay 9295bb5b5d
Unit test cleanup (#81958)
Remove obsolete Python 2.7 and 3.6 support code and fix up existing tests.
2 years ago
Matt Clay fd0f48e99d
ansible-test - Update base/default containers (#81957) 2 years ago
Matt Davis d8484f0af7
Update default test container Python to 3.12 and support for PyLint 3.0.1 (#81953)
* temporary PyLint plugin to mask 3.12 finalizer noise

* ansible-test - Default to Python 3.12 for base/default

* ansible-test - Update pylint requirements

* ansible-test - Remove obsoleted changelog entry

* Add changelog fragment for pylint work-around
2 years ago
Sviatoslav Sydorenko d2ba76c117
Remove Python `< 3.5` `selectors` fallbacks (#81872) 2 years ago
Sviatoslav Sydorenko 46623b0a96
Deprecate `pycompat24` (#81896) 2 years ago
Sviatoslav Sydorenko 350a394185
Remove Python 2 importlib.import_module compat (#81879) 2 years ago
Matt Martz 92d2c66db2
Remove py2 support from urls.py (#81880) 2 years ago
Klaas Demter 858a3dbaad
Fix example in strftime filter plugin help (#81696)
* Move the timestamp example to to_datetime.yml and be more verbose in its description
2 years ago
Jordan Borean 8a5ccc9d63
ansible-galaxy - fix traceback error for invalid req file (#81917)
Provide a better error message when encountering a YAML requirements file that is not a dictionary or list.

Fixes: #81901
2 years ago
Jordan Borean 976067c15f
Add more winrm coverage (#81923) 2 years ago
Jordan Borean 282908c57e
Add test coverage for winrm (#81910) 2 years ago
Matt Clay 16b23d6779
Rename boilerplate sanity test (#81903)
The test covers more than just future boilerplate, so the shorter name is more appropriate.
2 years ago
Matt Clay 9f899f9492
Require `from __future__ import annotations` (#81902) 2 years ago
Matt Clay 921efce43a
ansible-test - Remove more Python 2.7 / 3.6 support (#81898) 2 years ago
Jordan Borean dfc62589f6
win_fetch - improve test time by not scanning Win dir (#81884) 2 years ago
Abhijeet Kasurde c0eefa955a
docs: update error message (#81554)
* Reword the error message when the module fails to parse parameters
  in JSON format
* misc typo fixes

Fixes: #81188

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Kunal Vardani d67d8bd823
Misc typo fixes in connection plugin (#81883) 2 years ago
Matt Clay b94ee1cefd
Drop Python 2.7 and Python 3.6 support (#81866)
* Drop Python 2.7 and Python 3.6 support

* Remove obsolete _json_compat
2 years ago
Matt Davis c1343cc304
switch available_hosts to `frozenset` from `list` in ansible-inventory (#81870)
* major speedup large inventories, since it's consulted iteratively
2 years ago
Sloane Hertel debf2be913
optimize host_group_vars and vars plugin loading (#79945)
* Improve host_group_vars efficiency:

* normalize the basedir with `os.path.realpath()` once and cache it
* cache missing paths/files
* reduce the calls to `isinstance`

Add a couple more general improvements in vars/plugins.py get_vars_from_path():

* call `PluginLoader.all()` once for vars plugins and reload specific
  plugins subsequently
* don't reload legacy/builtin vars plugins that are not enabled

Add a test for host_group_vars and legacy plugin loading

Co-authored-by: Matt Davis <mrd@redhat.com>

* changelog

* Add a new is_stateless attribute to the vars plugin baseclass

update integration tests to be quieter and use the same test pattern

Fix deprecation and adjust test that didn't catch the issue (deprecation only occured when the value was False)

move realpath cache to host_group_vars (do not smuggle call state as instance data)

refactor under a single 'if cache:' statement

Call os.path.isdir instead of always calling os.path.exists first. Just call os.path.exists to differentiate between missing and non-directory.

remove call to super(VarsModule, self).get_vars()

use the entity name as the cache key instead of variable location

Remove isinstance checks and use a class attribute just in case any plugins are subclassing Host/Group

Replace startswith by checking index 0 of the name instead, since host/group names are required

* rename is_stateless to cache_instance to make it more clear what it does

* add plugin instance cache using the path to plugin loader

reduce loading stage option if a new instance isn't created

don't require a known subdir on PluginLoader instantiation for backwards
compatibility

rename attribute again

contain reading from/initializing cached instances to a plugin loader method

* Deprecate v2 vars plugins

* Refactor to use the cache in existing plugin loader methods

Rename the attribute again

Refactor host_group_vars with requested changes

Make changelog a bugfixes fragment

Add a deprecation fragment for v2 vars plugins.

Add type hints

* unbreak group_vars

* Apply suggestions from code review

* misc tweaks

* always cache instance by both requested and resolved FQ name
* add lru_cache to stage calculation to avoid repeated config consultation

* handle KeyError from missing stage option

---------

Co-authored-by: Matt Davis <mrd@redhat.com>
2 years ago
Martin Krizek 9b3ed5ec68
Properly template tags in parent blocks (#81624)
When templating tags (which happens outside of standard `post_validate`) we
need to template each object in the inheritance chain and set the templated
values on those objects individually. That way when `task.tags` is called the
`extend` functionality properly picks up the templated values of all
parents into one flatten list.

Fixes #81053
2 years ago
Abhijeet Kasurde 304e63d76e
Add family fallback for Amzn to register as RedHat (#81755)
* Add family fallback for Amzn to register as RedHat

Fixes: #80882

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Martin Krizek 2d5861c185
run_once: unnotify hosts on handlers that are not run (#81667)
Fixes #81666
2 years ago
Sloane Hertel 000cf1dd46
Update the test containers to include Python3.12.0 final (#81858) 2 years ago
Sloane Hertel b3408ab80b
Fix dnf module crash for non-existent url (#81801)
* ci_complete ci_coverage
2 years ago
Martin Krizek 116766ac3e
Add intentional tests for dnf group remove (#81739)
* Add intentional tests for dnf group remove

* Copy tests from yum
2 years ago
Matt Clay b7903669b4
ansible-test - Update distro containers (#81851)
* ansible-test - Update distro containers

* Update the alpine3 container to Python 3.11

* Update changelog
2 years ago
Matt Clay 20f17687da
ansible-test - Invoke container sleep through env (#81853) 2 years ago
Abhijeet Kasurde d8f791d88c
Bump sanity test requirements for 3.12 (#81846) 2 years ago
Abhijeet Kasurde ce3954ba74
Bump sanity test requirements for 3.12 (#81843) 2 years ago
Sviatoslav Sydorenko ec265ec08a
Bump `coverage.py` to v7.3.2 in `ansible-test` (#81844) 2 years ago
Matt Clay f31c287348
ansible-test - Improve compatibility with pylint 3 (#81841) 2 years ago
Martin Krizek e756e359e0
Remove deprecated JINJA2_NATIVE_WARNING env var (#81720)
Fixes #81714
2 years ago
Brian Coca ab6a544e86
Import role public (#81772)
revert to previous behavior to push vars to play at compile time
add `public` parameter to allow per import control of exporting (vs just the global config)

Co-authored-by: tchernomax <maxime.deroucy@gmail.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Matt Martz e78cc1e602
Install upgraded crun from edge (#81833) 2 years ago
Sloane Hertel 7fab552563
Fix reporting role as not found when remote_data is None (#81829) 2 years ago
Prashant Shukla a82dc06116
Update winrm.py (#81817)
fixes some of the issues in #81808
2 years ago
Omnath Mandal 8bf1a41d58
Fixed typos in winrm.py file (#81825)
bewteen ==> between
alligns ==> aligns
2 years ago
Rose Jethani 7109d392fd
fixes spelling errors (#81814) 2 years ago
Abhijeet Kasurde 4d4c50f856
Provide more info about plugin in deprecation message (#81719)
Provide more information about plugin usage which needs to be
used instead of the deprecated plugin in the deprecation message.

Fixes: #80561

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
lukaslihotzki-f 27bbff7c22
Add count and mandatory_count parameters in regex_replace filter (#81775) 2 years ago
Martin Krizek 01d190f3d2
Add intentional tests for module_utils/yumdnf.py (#81776) 2 years ago
Matt Clay d6a356d7cd
ansible-test - Update sanity test requirements (#81810) 2 years ago
Abhijeet Kasurde 55f27a579e
systemd_service: add a note about module rename (#81803)
* The module systemd is renamed to systemd_service to maintain
  the scope of the module. Mention this in the module description.
* Misc typo fixes.

Fixes: #80917

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Sloane Hertel cb8cb8936a
Update ansible-test containers
* Include Python 3.12rc3 and PowerShell 7.3.7
2 years ago
Jordan Borean f22231de20
winrm - make command input more resiliant (#81538)
* winrm - make command input more resiliant

* Expand warning message
2 years ago
Martin Krizek 60c9660952
Add intentional tests for dnf install rpm when higher version is installed (#81740)
* Add intentional tests for dnf install rpm when higher version is installed

* ci_complete ci_coverage
2 years ago
Matt Martz 68ab02a504
Test heuristic_log_sanitize (#81730)
* Test heuristic_log_sanitize. See #81689

* Add note about what this test is doing

* grammar

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

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Ikko Eltociear Ashimine f951c64ee9
Fix typo in finished.yml (#81784)
aysnc -> async
2 years ago
Abhijeet Kasurde 4071f3b803
file: add a note about follow=false (#81788)
While creating a symlink, we apply fs attributes changes
to the destination. But in case of a non-existent destination, we warn
the user. This warning message can be suppressed by setting follow=false.
Add a note of this behavior in the `follow` parameter.

Fixes: #50543

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Martz ddf0311c63
Prevent roles from using symlinks to overwrite files outside of the installation directory (#81780)
* Sanitize linkname during role installs

* Add tests

* add clog frag
2 years ago
Abhijeet Kasurde 989ea7a9f0
Misc. fixes in base.yml (#81771)
* Convert Latin short forms to English wording
* Typo fixes
* Sentence rewording

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Hungtsetse 51f2ddd445
Extend mount info (#81768) 2 years ago
Sloane Hertel 230f956e25
Add lineinfile integration test for removing a line that has already been removed (#81762)
ci_complete ci_coverage
2 years ago
mschmookler 7d9889fcb3
Fix typo in action_core.py (#81763)
Fixes typo 'obeys' vs 'objeys' in doc_fragments/action_core.py
2 years ago
Sloane Hertel 85adaa76f1
Add integration test for copy with force=false when dest exists (#81756)
ci_complete ci_coverage
2 years ago
Val 91f94fb59d
Daemonize follow-up fixes (#81584)
* Ensure binary data transmission in daemonize

* Add changelog fragment
2 years ago
Matt Clay 3794612832
ansible-test - Skip pylint test on Python 3.12 (#81706) 2 years ago
Brian Coca 2aef0406d4
ansible-galaxy fix scm dependency error (#81599)
* ansible-galaxy fix scm dependency error

  also changed usage of 'virtual colleciton' to actual type
  avoid error by filtering out virtual collections that dont have
expected properties

simplified as per webknjaz

* Update lib/ansible/galaxy/collection/__init__.py
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2 years ago
Matt Martz 7c7385521e
Harden the ansiballz and respawn python templates (#81753)
Harden our python templates for respawn and ansiballz around str literal quoting
2 years ago
Brian Coca 9edf64eaeb
Deprecating paramiko options in base config (#81593)
* Deprecating paramiko options in base config

 they exist in the plugin itself since 2.14

* clog
2 years ago
Martin Krizek 1e7f7875c6
Allow for searching handler subdir for included task via include_role (#81733)
Fixes #81722
2 years ago
Abhijeet Kasurde 86fd7026a8
Handle exceptions in interpreter discovery (#81745)
* Handle exceptions like AnsibleError, AnsibleConnectionFailure
  raise while interpreter discovery.

Fixes: #78264

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Martin Krizek 62c10199d1
Add intentional tests for dnf list (#81738)
ci_complete ci_coverage
2 years ago
Carlos Camacho 9244b2bff8
Make sure paths are treated correctly when building collection files manifest (#81619)
* Make sure paths are correct when building collection files manifest

This commit makes sure the path of the files part of
the collection build manifest are correct.

This commit uses os.path.commonprefix instead of
dealing with strings.

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>

Bugfix Pull Request
Fixes: #81618

* Revert the change note type to `minor_changes`

* Clarify the change note with user-oriented details

---------

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2 years ago
René Moser e4b9f9c6ae
tests: update CloudStack test container to version 1.7.0. (#81732) 2 years ago
Sviatoslav Sydorenko 7662a05085
Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree
PR #81606.

Prior to this patch, when `--pre` CLI flag was not passed, the
dependency resolver would treat concrete collection dependency
candidates (Git repositories, subdirs, tarball URLs, or local dirs or
files etc) as not meeting the requirements.

This patch makes it so pre-releases in any concrete artifact
references, and the ones being specifically pinned dependencies or
user requests, met anywhere in the dependency tree, are allowed
unconditionally.

This is achieved by moving the pre-release check from
`is_satisfied_by()` to the `find_matches()` hook, following the
Pip's example.

As a bonus, this change also fixes the situation when a collection
pre-releases weren't considered if it didn't have any stable releases.
This now works even if `--pre` wasn't requested explicitly.

Finally, this patch partially reverts commit
6f4b4c345b, except for the tests. And it
also improves the `--pre` hint warning to explain that it mostly
affects Galaxy/Automation Hub-hosted collection releases.

Ref #73416
Ref #79112
Fixes #79168
Fixes #80048
Resolves #81605

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Abhijeet Kasurde 4b7705b07a
Remove deprecated APIs from ansible-doc (#81729)
* Removed add_collection_plugins
* Removed find_plugins

Fixes: #81716

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Martz 3ec7a6e0db
Fix ansible-test issues with detecting docker host and forwarding ports (#81726)
* Properly detect docker host using ssh

* Disable ControlPath when creating SSH port forwards

* typo fix

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

* Add clog frag

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Webcrétaire 710c0a264e
Typo in documentation `then` -> `than` (#81724) 2 years ago
Abhijeet Kasurde 0ea40e09d1
vars: handle exception in combine_vars (#81700)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Martz f7234968d2
bump devel to 2.17.0.dev0 (#81712) 2 years 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:4.0.1 value: quay.io/ansible/azure-pipelines-test-container:7.0.0
pool: Standard pool: Standard
@ -54,14 +54,12 @@ stages:
nameFormat: Python {0} nameFormat: Python {0}
testFormat: units/{0} testFormat: units/{0}
targets: targets:
- test: 2.7
- test: 3.6
- test: 3.7
- 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.14
- stage: Windows - stage: Windows
dependsOn: [] dependsOn: []
jobs: jobs:
@ -70,43 +68,50 @@ stages:
nameFormat: Server {0} nameFormat: Server {0}
testFormat: windows/{0}/1 testFormat: windows/{0}/1
targets: targets:
- test: 2016 - name: 2016 WinRM HTTP
- test: 2019 test: 2016/winrm/http
- test: 2022 - name: 2019 WinRM HTTPS
test: 2019/winrm/https
- name: 2022 WinRM HTTPS
test: 2022/winrm/https
- name: 2022 PSRP HTTP
test: 2022/psrp/http
- name: 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 13.2 - name: macOS 15.3
test: macos/13.2 test: macos/15.3
- name: RHEL 7.9 - name: RHEL 9.6 py39
test: rhel/7.9 test: rhel/9.6@3.9
- name: RHEL 8.8 py36 - name: RHEL 9.6 py312
test: rhel/8.8@3.6 test: rhel/9.6@3.12
- name: RHEL 8.8 py311 - name: RHEL 10.0
test: rhel/8.8@3.11 test: rhel/10.0
- name: RHEL 9.2 py39 - name: FreeBSD 13.5
test: rhel/9.2@3.9 test: freebsd/13.5
- name: RHEL 9.2 py311 - name: FreeBSD 14.3
test: rhel/9.2@3.11 test: freebsd/14.3
- name: FreeBSD 13.2
test: freebsd/13.2
groups: groups:
- 1 - 1
- 2 - 2
- template: templates/matrix.yml # context/controller - template: templates/matrix.yml # context/controller
parameters: parameters:
targets: targets:
- name: macOS 13.2 - name: macOS 15.3
test: macos/13.2 test: macos/15.3
- name: RHEL 8.8 - name: RHEL 9.6
test: rhel/8.8 test: rhel/9.6
- name: RHEL 9.2 - name: RHEL 10.0
test: rhel/9.2 test: rhel/10.0
- name: FreeBSD 13.2
test: freebsd/13.2
groups: groups:
- 3 - 3
- 4 - 4
@ -114,54 +119,58 @@ 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.18 - name: Alpine 3.22
test: alpine/3.18 test: alpine/3.22
- name: Fedora 38 - name: Fedora 42
test: fedora/38 test: fedora/42
- name: RHEL 8.8 - name: RHEL 9.6
test: rhel/8.8 test: rhel/9.6
- name: RHEL 9.2 - name: RHEL 10.0
test: rhel/9.2 test: rhel/10.0
- name: Ubuntu 22.04 - name: Ubuntu 24.04
test: ubuntu/22.04 test: ubuntu/24.04
groups: groups:
- 6 - 6
- stage: Docker - stage: Docker
dependsOn: [] dependsOn: []
jobs: jobs:
- template: templates/matrix.yml - template: templates/matrix.yml # context/target
parameters: parameters:
testFormat: linux/{0} testFormat: linux/{0}
targets: targets:
- name: Alpine 3 - name: Alpine 3.22
test: alpine3 test: alpine322
- name: CentOS 7 - name: Fedora 42
test: centos7 test: fedora42
- name: Fedora 38
test: fedora38
- name: openSUSE 15
test: opensuse15
- name: Ubuntu 20.04
test: ubuntu2004
- name: Ubuntu 22.04 - name: Ubuntu 22.04
test: ubuntu2204 test: ubuntu2204
- name: Ubuntu 24.04
test: ubuntu2404
groups: groups:
- 1 - 1
- 2 - 2
- template: templates/matrix.yml - template: templates/matrix.yml # context/controller
parameters: parameters:
testFormat: linux/{0} testFormat: linux/{0}
targets: targets:
- name: Alpine 3 - name: Alpine 3.22
test: alpine3 test: alpine322
- name: Fedora 38 - name: Fedora 42
test: fedora38 test: fedora42
- name: Ubuntu 22.04 - name: Ubuntu 24.04
test: ubuntu2204 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:
@ -170,9 +179,9 @@ stages:
nameFormat: Python {0} nameFormat: Python {0}
testFormat: galaxy/{0}/1 testFormat: galaxy/{0}/1
targets: targets:
- test: '3.10'
- test: 3.11
- test: 3.12 - test: 3.12
- test: 3.13
- test: 3.14
- stage: Generic - stage: Generic
dependsOn: [] dependsOn: []
jobs: jobs:
@ -181,9 +190,9 @@ stages:
nameFormat: Python {0} nameFormat: Python {0}
testFormat: generic/{0}/1 testFormat: generic/{0}/1
targets: targets:
- test: '3.10'
- test: 3.11
- test: 3.12 - test: 3.12
- test: 3.13
- test: 3.14
- stage: Incidental_Windows - stage: Incidental_Windows
displayName: Incidental Windows displayName: Incidental Windows
dependsOn: [] dependsOn: []
@ -193,20 +202,20 @@ stages:
nameFormat: Server {0} nameFormat: Server {0}
testFormat: i/windows/{0} testFormat: i/windows/{0}
targets: targets:
- test: 2016 - name: 2016 WinRM HTTP
- test: 2019 test: 2016/winrm/http
- test: 2022 - name: 2019 WinRM HTTPS
- stage: Incidental test: 2019/winrm/https
dependsOn: [] - name: 2022 WinRM HTTPS
jobs: test: 2022/winrm/https
- template: templates/matrix.yml - name: 2022 PSRP HTTP
parameters: test: 2022/psrp/http
testFormat: i/{0}/1 - name: 2022 SSH Key
targets: test: 2022/ssh/key
- name: IOS Python - name: 2025 PSRP HTTP
test: ios/csr1000v/ test: 2025/psrp/http
- name: VyOS Python - name: 2025 SSH Key
test: vyos/1.1.8/ test: 2025/ssh/key
- 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

@ -6,6 +6,8 @@ declare -a args
IFS='/:' read -ra args <<< "$1" IFS='/:' read -ra args <<< "$1"
version="${args[1]}" version="${args[1]}"
connection="${args[2]}"
connection_setting="${args[3]}"
target="shippable/windows/incidental/" target="shippable/windows/incidental/"
@ -26,11 +28,7 @@ if [ -s /tmp/windows.txt ] || [ "${CHANGED:+$CHANGED}" == "" ]; then
echo "Detected changes requiring integration tests specific to Windows:" echo "Detected changes requiring integration tests specific to Windows:"
cat /tmp/windows.txt cat /tmp/windows.txt
echo "Running Windows integration tests for multiple versions concurrently." echo "Running Windows integration tests for the version ${version}."
platforms=(
--windows "${version}"
)
else else
echo "No changes requiring integration tests specific to Windows were detected." echo "No changes requiring integration tests specific to Windows were detected."
echo "Running Windows integration tests for a single version only: ${single_version}" echo "Running Windows integration tests for a single version only: ${single_version}"
@ -39,14 +37,10 @@ else
echo "Skipping this job since it is for: ${version}" echo "Skipping this job since it is for: ${version}"
exit 0 exit 0
fi fi
platforms=(
--windows "${version}"
)
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
ansible-test windows-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \ ansible-test windows-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
"${platforms[@]}" \ --controller "docker:default,python=${python_default}" \
--docker default --python "${python_default}" \ --target "remote:windows/${version},connection=${connection}+${connection_setting},provider=${provider}" \
--remote-terminate always --remote-stage "${stage}" --remote-provider "${provider}" --remote-terminate always --remote-stage "${stage}"

@ -6,7 +6,9 @@ declare -a args
IFS='/:' read -ra args <<< "$1" IFS='/:' read -ra args <<< "$1"
version="${args[1]}" version="${args[1]}"
group="${args[2]}" connection="${args[2]}"
connection_setting="${args[3]}"
group="${args[4]}"
target="shippable/windows/group${group}/" target="shippable/windows/group${group}/"
@ -31,11 +33,7 @@ if [ -s /tmp/windows.txt ] || [ "${CHANGED:+$CHANGED}" == "" ]; then
echo "Detected changes requiring integration tests specific to Windows:" echo "Detected changes requiring integration tests specific to Windows:"
cat /tmp/windows.txt cat /tmp/windows.txt
echo "Running Windows integration tests for multiple versions concurrently." echo "Running Windows integration tests for the version ${version}."
platforms=(
--windows "${version}"
)
else else
echo "No changes requiring integration tests specific to Windows were detected." echo "No changes requiring integration tests specific to Windows were detected."
echo "Running Windows integration tests for a single version only: ${single_version}" echo "Running Windows integration tests for a single version only: ${single_version}"
@ -44,17 +42,13 @@ else
echo "Skipping this job since it is for: ${version}" echo "Skipping this job since it is for: ${version}"
exit 0 exit 0
fi fi
platforms=(
--windows "${version}"
)
fi fi
for version in "${python_versions[@]}"; do for py_version in "${python_versions[@]}"; do
changed_all_target="all" changed_all_target="all"
changed_all_mode="default" changed_all_mode="default"
if [ "${version}" == "${python_default}" ]; then if [ "${py_version}" == "${python_default}" ]; then
# smoketest tests # smoketest tests
if [ "${CHANGED}" ]; then if [ "${CHANGED}" ]; then
# with change detection enabled run tests for anything changed # with change detection enabled run tests for anything changed
@ -80,7 +74,7 @@ for version in "${python_versions[@]}"; do
fi fi
# terminate remote instances on the final python version tested # terminate remote instances on the final python version tested
if [ "${version}" = "${python_versions[-1]}" ]; then if [ "${py_version}" = "${python_versions[-1]}" ]; then
terminate="always" terminate="always"
else else
terminate="never" terminate="never"
@ -88,7 +82,8 @@ for version in "${python_versions[@]}"; do
# shellcheck disable=SC2086 # shellcheck disable=SC2086
ansible-test windows-integration --color -v --retry-on-error "${ci}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \ ansible-test windows-integration --color -v --retry-on-error "${ci}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
"${platforms[@]}" --changed-all-target "${changed_all_target}" --changed-all-mode "${changed_all_mode}" \ --changed-all-target "${changed_all_target}" --changed-all-mode "${changed_all_mode}" \
--docker default --python "${version}" \ --controller "docker:default,python=${py_version}" \
--remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}" --target "remote:windows/${version},connection=${connection}+${connection_setting},provider=${provider}" \
--remote-terminate "${terminate}" --remote-stage "${stage}"
done done

@ -7,8 +7,7 @@ Keep in mind that Azure Pipelines does not enforce unique job display names (onl
It is up to pipeline authors to avoid name collisions when deviating from the recommended format. It is up to pipeline authors to avoid name collisions when deviating from the recommended format.
""" """
from __future__ import (absolute_import, division, print_function) from __future__ import annotations
__metaclass__ = type
import os import os
import re import re

@ -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

@ -4,15 +4,20 @@ Upload code coverage reports to codecov.io.
Multiple coverage files from multiple languages are accepted and aggregated after upload. Multiple coverage files from multiple languages are accepted and aggregated after upload.
Python coverage, as well as PowerShell and Python stubs can all be uploaded. Python coverage, as well as PowerShell and Python stubs can all be uploaded.
""" """
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)
@ -42,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'):
@ -56,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:
if dry_run:
print(f'DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}')
return
with urllib.request.urlopen(url) as resp: def report_upload_completion(
with dest.open('w+b') as f: codecov_bin: pathlib.Path,
# Read data in chunks rather than all at once config_file: pathlib.Path,
shutil.copyfileobj(resp, f, 64 * 1024) dry_run: bool = False,
) -> None:
"""Notify Codecov backend that all reports we wanted are in."""
cmd = [
codecov_bin,
'--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

@ -1,8 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout.""" """Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
from __future__ import (absolute_import, division, print_function) from __future__ import annotations
__metaclass__ = type
import sys import sys
import time import time

@ -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

@ -4,22 +4,75 @@ Hi! Nice to see you here!
## QUESTIONS ? ## QUESTIONS ?
Please see the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) for information on how to ask questions on the [mailing lists](https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information) and IRC. If you have questions about anything related to Ansible, get in touch with us!
See [Communicating with the Ansible community](https://docs.ansible.com/ansible/devel/community/communication.html) to find out how.
The GitHub issue tracker is not the best place for questions for various reasons, but both IRC and the mailing list are very helpful places for those things, as the community page explains best. The [Community Guide](https://docs.ansible.com/ansible/devel/community/index.html) also explains how to contribute
and interact with the project, including how to submit bug reports and code to Ansible.
Please note that the GitHub issue tracker is not the best place to ask questions for several reasons.
You'll get more helpful, and quicker, responses in the forum.
## CONTRIBUTING ? ## CONTRIBUTING ?
By contributing you agree that these contributions are your own (or approved by your employer) and you grant a full, complete, irrevocable copyright license to all users and developers of the project, present and future, pursuant to the license of the project. You can also read the same [CLA](https://docs.ansible.com/ansible/latest/community/contributor_license_agreement.html) on the Ansible docsite. By contributing to this project you agree to the [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco).
The Ansible project is licensed under the [GPL-3.0](COPYING) or later. Some portions of the code fall under other licenses as noted in individual files.
Please review the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) for more information on contributing to Ansible. The Ansible project accepts contributions through GitHub pull requests.
Please review the [Community Guide](https://docs.ansible.com/ansible/devel/community/index.html) for more information on contributing to Ansible.
## BUG TO REPORT ? ## BUG TO REPORT ?
First and foremost, also check the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html). First and foremost, also check the [Community Guide](https://docs.ansible.com/ansible/devel/community/index.html).
You can report bugs or make enhancement requests at the [Ansible GitHub issue page](http://github.com/ansible/ansible/issues/new/choose) by filling out the issue template that will be presented. You can report bugs or make enhancement requests at
the [Ansible GitHub issue page](http://github.com/ansible/ansible/issues/new/choose) by filling out the issue template that will be presented.
Also please make sure you are testing on the latest released version of Ansible or the development branch; see the [Installation Guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) for details. Also please make sure you are testing on the latest released version of Ansible or the development branch.
See the [Installation Guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) for details.
Thanks! Thanks!
## DEVELOPER CERTIFICATE OF ORIGIN (DCO)
This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution.
```text
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

@ -19,13 +19,14 @@ body:
Also test if the latest release and devel branch are affected too. Also test if the latest release and devel branch are affected too.
**Tip:** If you are seeking community support, please consider **Tip:** If you are seeking community support, please see
[starting a mailing list thread or chatting in IRC][ML||IRC]. [Communicating with the Ansible community][communication] to
get in touch and ask questions.
[ML||IRC]: [communication]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--bug_report.yml#mailing-list-information https://docs.ansible.com/ansible/devel/community/communication.html
[issue search]: ../search?q=is%3Aissue&type=issues [issue search]: ../search?q=is%3Aissue&type=issues
@ -46,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 unfortunatelly, the curent
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:
@ -87,7 +72,7 @@ body:
[collections org]: /ansible-collections [collections org]: /ansible-collections
placeholder: dnf, apt, yum, pip, user etc. placeholder: dnf, apt, pip, user etc.
validations: validations:
required: true required: true
@ -120,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
@ -151,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: |
@ -258,7 +244,7 @@ body:
description: | description: |
Read the [Ansible Code of Conduct][CoC] first. Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--bug_report.yml [CoC]: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--bug_report.yml
options: options:
- label: I agree to follow the Ansible Code of Conduct - label: I agree to follow the Ansible Code of Conduct
required: true required: true

@ -2,7 +2,7 @@
blank_issues_enabled: false # default: true blank_issues_enabled: false # default: true
contact_links: contact_links:
- name: 🔐 Security bug report 🔥 - name: 🔐 Security bug report 🔥
url: https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser url: https://docs.ansible.com/ansible/devel/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser
about: | about: |
Please learn how to report security vulnerabilities here. Please learn how to report security vulnerabilities here.
@ -11,15 +11,15 @@ contact_links:
a prompt response. a prompt response.
For more information, see For more information, see
https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html https://docs.ansible.com/ansible/devel/community/reporting_bugs_and_features.html
- name: 📝 Ansible Code of Conduct - name: 📝 Ansible Code of Conduct
url: https://docs.ansible.com/ansible/latest/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: 💬 Talks to the community - name: 💬 Talk to the community
url: https://docs.ansible.com/ansible/latest/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

@ -22,12 +22,14 @@ body:
Also test if the latest release and devel branch are affected too. Also test if the latest release and devel branch are affected too.
**Tip:** If you are seeking community support, please consider **Tip:** If you are seeking community support, please see
[starting a mailing list thread or chatting in IRC][ML||IRC]. [Communicating with the Ansible community][communication] to
get in touch and ask questions.
[ML||IRC]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--documentation_report.yml#mailing-list-information [communication]:
https://docs.ansible.com/ansible/devel/community/communication.html
[issue search]: ../search?q=is%3Aissue&type=issues [issue search]: ../search?q=is%3Aissue&type=issues
@ -82,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:
@ -141,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.
@ -205,7 +196,7 @@ body:
description: | description: |
Read the [Ansible Code of Conduct][CoC] first. Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--documentation_report.yml [CoC]: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--documentation_report.yml
options: options:
- label: I agree to follow the Ansible Code of Conduct - label: I agree to follow the Ansible Code of Conduct
required: true required: true

@ -21,8 +21,7 @@ body:
If unsure, consider filing a [new proposal] instead outlining your If unsure, consider filing a [new proposal] instead outlining your
use-cases, the research and implementation considerations. Then, use-cases, the research and implementation considerations. Then,
start a discussion on one of the public [IRC meetings] we have just start a discussion in the [Ansible forum][forum].
for this.
<details> <details>
@ -44,21 +43,22 @@ body:
Also test if the devel branch does not already implement this. Also test if the devel branch does not already implement this.
**Tip:** If you are seeking community support, please consider **Tip:** If you are seeking community support, please see
[starting a mailing list thread or chatting in IRC][ML||IRC]. [Communicating with the Ansible community][communication] to
get in touch and ask questions.
[contribute to collections]: [contribute to collections]:
https://docs.ansible.com/ansible-core/devel/community/contributing_maintained_collections.html?utm_medium=github&utm_source=issue_form--feature_request.yml https://docs.ansible.com/ansible-core/devel/community/contributing_maintained_collections.html?utm_medium=github&utm_source=issue_form--feature_request.yml
[IRC meetings]: [communication]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--feature_request.yml#irc-meetings https://docs.ansible.com/ansible/devel/community/communication.html
[issue search]: ../search?q=is%3Aissue&type=issues [issue search]: ../search?q=is%3Aissue&type=issues
[ML||IRC]: [forum help]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--feature_request.yml#mailing-list-information https://forum.ansible.com/c/help/6
[new proposal]: ../../proposals/issues/new [new proposal]: ../../proposals/issues/new
@ -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 unfortunatelly, the curent
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:
@ -139,7 +123,7 @@ body:
[collections org]: /ansible-collections [collections org]: /ansible-collections
placeholder: dnf, apt, yum, pip, user etc. placeholder: dnf, apt, pip, user etc.
validations: validations:
required: true required: true
@ -185,7 +169,7 @@ body:
description: | description: |
Read the [Ansible Code of Conduct][CoC] first. Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--feature_request.yml [CoC]: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--feature_request.yml
options: options:
- label: I agree to follow the Ansible Code of Conduct - label: I agree to follow the Ansible Code of Conduct
required: true required: true

@ -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

@ -1,25 +0,0 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
- Bugfix Pull Request
- Docs Pull Request
- Feature 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
```

@ -0,0 +1 @@
PULL_REQUEST_TEMPLATE/Unclear purpose or motivation.md

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE
- Bugfix Pull Request

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Docs Pull Request

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Feature Pull Request

@ -0,0 +1 @@
Unclear purpose or motivation.md

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Test Pull Request

@ -0,0 +1,14 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
- Bugfix Pull Request
- Docs Pull Request
- Feature Pull Request
- Test Pull Request

@ -1,3 +1,7 @@
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.17.0 Gallows Pole
2.16.0 All My Love 2.16.0 All My Love
2.15.0 Ten Years Gone 2.15.0 Ten Years Gone
2.14.0 C'mon Everybody 2.14.0 C'mon Everybody

7
.gitignore vendored

@ -92,9 +92,14 @@ Vagrantfile
/lib/ansible_base.egg-info/ /lib/ansible_base.egg-info/
# First used in the `devel` branch during Ansible 2.11 development. # First used in the `devel` branch during Ansible 2.11 development.
/lib/ansible_core.egg-info/ /lib/ansible_core.egg-info/
# First used in the `devel` branch during Ansible 2.18 development.
/ansible_core.egg-info/
# 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
@ -122,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,11 +1,10 @@
include COPYING include COPYING
include bin/*
include changelogs/CHANGELOG*.rst include changelogs/CHANGELOG*.rst
include changelogs/changelog.yaml include changelogs/changelog.yaml
include licenses/*.txt include licenses/*.txt
include requirements.txt include requirements.txt
recursive-include packaging *.py *.j2 recursive-include packaging *.py *.j2
recursive-include test/integration * recursive-include test/integration *
recursive-include test/sanity *.in *.json *.py *.txt recursive-include test/sanity *.in *.json *.py *.txt *.ini
recursive-include test/support *.py *.ps1 *.psm1 *.cs *.md recursive-include test/support *.py *.ps1 *.psm1 *.cs *.md
recursive-include test/units * recursive-include test/units *

@ -1,9 +1,9 @@
[![PyPI version](https://img.shields.io/pypi/v/ansible-core.svg)](https://pypi.org/project/ansible-core) [![PyPI version](https://img.shields.io/pypi/v/ansible-core.svg)](https://pypi.org/project/ansible-core)
[![Docs badge](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.ansible.com/ansible/latest/) [![Docs badge](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.ansible.com/ansible/latest/)
[![Chat badge](https://img.shields.io/badge/chat-IRC-brightgreen.svg)](https://docs.ansible.com/ansible/latest/community/communication.html) [![Chat badge](https://img.shields.io/badge/chat-IRC-brightgreen.svg)](https://docs.ansible.com/ansible/devel/community/communication.html)
[![Build Status](https://dev.azure.com/ansible/ansible/_apis/build/status/CI?branchName=devel)](https://dev.azure.com/ansible/ansible/_build/latest?definitionId=20&branchName=devel) [![Build Status](https://dev.azure.com/ansible/ansible/_apis/build/status/CI?branchName=devel)](https://dev.azure.com/ansible/ansible/_build/latest?definitionId=20&branchName=devel)
[![Ansible Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-Ansible-silver.svg)](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) [![Ansible Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-Ansible-silver.svg)](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html)
[![Ansible mailing lists](https://img.shields.io/badge/mailing%20lists-Ansible-orange.svg)](https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information) [![Ansible mailing lists](https://img.shields.io/badge/mailing%20lists-Ansible-orange.svg)](https://docs.ansible.com/ansible/devel/community/communication.html#mailing-list-information)
[![Repository License](https://img.shields.io/badge/license-GPL%20v3.0-brightgreen.svg)](COPYING) [![Repository License](https://img.shields.io/badge/license-GPL%20v3.0-brightgreen.svg)](COPYING)
[![Ansible CII Best Practices certification](https://bestpractices.coreinfrastructure.org/projects/2372/badge)](https://bestpractices.coreinfrastructure.org/projects/2372) [![Ansible CII Best Practices certification](https://bestpractices.coreinfrastructure.org/projects/2372/badge)](https://bestpractices.coreinfrastructure.org/projects/2372)
@ -40,21 +40,33 @@ features and fixes, directly. Although it is reasonably stable, you are more lik
breaking changes when running the `devel` branch. We recommend getting involved breaking changes when running the `devel` branch. We recommend getting involved
in the Ansible community if you want to run the `devel` branch. in the Ansible community if you want to run the `devel` branch.
## Get Involved ## Communication
* Read [Community Information](https://docs.ansible.com/ansible/latest/community) for all Join the Ansible forum to ask questions, get help, and interact with the
community.
* [Get Help](https://forum.ansible.com/c/help/6): Find help or share your Ansible knowledge to help others.
Use tags to filter and subscribe to posts, such as the following:
* Posts tagged with [ansible](https://forum.ansible.com/tag/ansible)
* Posts tagged with [ansible-core](https://forum.ansible.com/tag/ansible-core)
* Posts tagged with [playbook](https://forum.ansible.com/tag/playbook)
* [Social Spaces](https://forum.ansible.com/c/chat/4): Meet and interact with fellow enthusiasts.
* [News & Announcements](https://forum.ansible.com/c/news/5): Track project-wide announcements including social events.
* [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): Get release announcements and important changes.
For more ways to get in touch, see [Communicating with the Ansible community](https://docs.ansible.com/ansible/devel/community/communication.html).
## Contribute to Ansible
* Check out the [Contributor's Guide](./.github/CONTRIBUTING.md).
* Read [Community Information](https://docs.ansible.com/ansible/devel/community) for all
kinds of ways to contribute to and interact with the project, kinds of ways to contribute to and interact with the project,
including mailing list information and how to submit bug reports and including how to submit bug reports and code to Ansible.
code to Ansible.
* Join a [Working Group](https://github.com/ansible/community/wiki),
an organized community devoted to a specific technology domain or platform.
* Submit a proposed code update through a pull request to the `devel` branch. * Submit a proposed code update through a pull request to the `devel` branch.
* Talk to us before making larger changes * Talk to us before making larger changes
to avoid duplicate efforts. This not only helps everyone to avoid duplicate efforts. This not only helps everyone
know what is going on, but it also helps save time and effort if we decide know what is going on, but it also helps save time and effort if we decide
some changes are needed. some changes are needed.
* For a list of email lists, IRC channels and Working Groups, see the
[Communication page](https://docs.ansible.com/ansible/latest/community/communication.html)
## Coding Guidelines ## Coding Guidelines
@ -67,7 +79,7 @@ We document our Coding Guidelines in the [Developer Guide](https://docs.ansible.
* The `devel` branch corresponds to the release actively under development. * The `devel` branch corresponds to the release actively under development.
* The `stable-2.X` branches correspond to stable releases. * The `stable-2.X` branches correspond to stable releases.
* Create a branch based on `devel` and set up a [dev environment](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#common-environment-setup) if you want to open a PR. * Create a branch based on `devel` and set up a [dev environment](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html#common-environment-setup) if you want to open a PR.
* See the [Ansible release and maintenance](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) page for information about active branches. * See the [Ansible release and maintenance](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) page for information about active branches.
## Roadmap ## Roadmap

@ -1 +0,0 @@
../lib/ansible/cli/scripts/ansible_connection_cli_stub.py

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

@ -1,2 +0,0 @@
minor_changes:
- tasks - the ``retries`` keyword can be specified without ``until`` in which case the task is retried until it succeeds but at most ``retries`` times (https://github.com/ansible/ansible/issues/20802)

@ -1,3 +0,0 @@
minor_changes:
- CLI argument parsing - Automatically prepend to the help of CLI arguments that support being specified multiple times.
(https://github.com/ansible/ansible/issues/22396)

@ -1,2 +0,0 @@
bugfixes:
- fetch - Handle unreachable errors properly (https://github.com/ansible/ansible/issues/27816)

@ -1,4 +0,0 @@
---
minor_changes:
- "ansible-vault create: Now raises an error when opening the editor without
tty. The flag --skip-tty-check restores previous behaviour."

@ -1,2 +0,0 @@
bugfixes:
- user - set expiration value correctly when unable to retrieve the current value from the system (https://github.com/ansible/ansible/issues/71916)

@ -1,2 +0,0 @@
bugfixes:
- Prevent running same handler multiple times when included via ``include_role`` (https://github.com/ansible/ansible/issues/73643)

@ -1,3 +0,0 @@
bugfixes:
- win_fetch - Add support for using file with wildcards in file name.
(https://github.com/ansible/ansible/issues/73128)

@ -1,3 +0,0 @@
bugfixes:
- modules/user.py - Add check for valid directory when creating new user homedir (allows /dev/null as skeleton) (https://github.com/ansible/ansible/issues/75063)

@ -1,6 +0,0 @@
---
bugfixes:
- >-
Fixed `pip` module failure in case of usage quotes for
`virtualenv_command` option for the venv command.
(https://github.com/ansible/ansible/issues/76372)

@ -1,6 +0,0 @@
---
minor_changes:
- >-
Add ``GALAXY_COLLECTIONS_PATH_WARNING`` option to disable the warning
given by ``ansible-galaxy collection install`` when installing a collection
to a path that isn't in the configured collection paths.

@ -1,6 +0,0 @@
---
bugfixes:
- template - Fix for formatting issues when a template path contains
valid jinja/strftime pattern (especially line break one) and
using the template path in ansible_managed
(https://github.com/ansible/ansible/pull/79129)

@ -1,2 +0,0 @@
bugfixes:
- replace - handle exception when bad escape character is provided in replace (https://github.com/ansible/ansible/issues/79364).

@ -1,2 +0,0 @@
bugfixes:
- module/role argument spec - validate the type for options that are None when the option is required or has a non-None default (https://github.com/ansible/ansible/issues/79656).

@ -1,2 +0,0 @@
bugfixes:
- "ansible-test local change detection - use ``git merge-base <branch> HEAD`` instead of ``git merge-base --fork-point <branch>`` (https://github.com/ansible/ansible/pull/79734)."

@ -1,2 +0,0 @@
bugfixes:
- setup gather_timeout - Fix timeout in get_mounts_facts for linux.

@ -1,2 +0,0 @@
minor_changes:
- 'ansible_user_module - tweaked macos user defaults to reflect expected defaults (https://github.com/ansible/ansible/issues/44316)'

@ -1,5 +0,0 @@
bugfixes:
- ansiballz - Prevent issue where the time on the control host could
change part way through building the ansiballz file, potentially causing
a pre-1980 date to be used during ansiballz unpacking leading to a zip
file error (https://github.com/ansible/ansible/issues/80089)

@ -1,3 +0,0 @@
bugfixes:
- file modules - Make symbolic modes with X use the computed permission, not original file (https://github.com/ansible/ansible/issues/80128)
- copy unit tests - Fixing "dir all perms" documentation and formatting for easier reading.

@ -1,2 +0,0 @@
bugfixes:
- iptables - remove default rule creation when creating iptables chain to be more similar to the command line utility (https://github.com/ansible/ansible/issues/80256).

@ -1,4 +0,0 @@
bugfixes:
- Display - Defensively configure writing to stdout and stderr with a custom encoding error handler that will replace invalid characters
while providing a deprecation warning that non-utf8 text will result in an error in a future version.
- module responses - Ensure that module responses are utf-8 adhereing to JSON RFC and expectations of the core code.

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy - reduce API calls to servers by fetching signatures only for final candidates.

@ -1,2 +0,0 @@
bugfixes:
- "validate-modules sanity test - replace semantic markup parsing and validating code with the code from `antsibull-docs-parser 0.2.0 <https://github.com/ansible-community/antsibull-docs-parser/releases/tag/0.2.0>`__ (https://github.com/ansible/ansible/pull/80406)."

@ -1,2 +0,0 @@
bugfixes:
- file modules - fix validating invalid symbolic modes.

@ -1,2 +0,0 @@
bugfixes:
- include_role - expose variables from parent roles to role's handlers (https://github.com/ansible/ansible/issues/80459)

@ -1,3 +0,0 @@
---
minor_changes:
- include_vars - os.walk now follows symbolic links when traversing directories (https://github.com/ansible/ansible/pull/80460)

@ -1,2 +0,0 @@
bugfixes:
- Fix post-validating looped task fields so the strategy uses the correct values after task execution.

@ -1,3 +0,0 @@
bugfixes:
- pip module - Update module to prefer use of the python ``packaging`` and ``importlib.metadata`` modules due to ``pkg_resources`` being deprecated
(https://github.com/ansible/ansible/issues/80488)

@ -1,3 +0,0 @@
bugfixes:
- syntax check - Limit ``--syntax-check`` to ``ansible-playbook`` only, as that is the only CLI affected by this argument
(https://github.com/ansible/ansible/issues/80506)

@ -1,2 +0,0 @@
bugfixes:
- The ``hostname`` module now also updates both current and permanent hostname on OpenBSD. Before it only updated the permanent hostname (https://github.com/ansible/ansible/issues/80520).

@ -1,2 +0,0 @@
minor_changes:
- cli - Added short option '-J' for asking for vault password (https://github.com/ansible/ansible/issues/80523).

@ -1,2 +0,0 @@
bugfixes:
- "Properly disable ``jinja2_native`` in the template module when jinja2 override is used in the template (https://github.com/ansible/ansible/issues/80605)"

@ -1,3 +0,0 @@
bugfixes:
- ansible-galaxy - fix installing signed collections (https://github.com/ansible/ansible/issues/80648).
- ansible-galaxy collection verify - fix verifying signed collections when the keyring is not configured.

@ -1,2 +0,0 @@
minor_changes:
- ansible-galaxy - Remove internal configuration argument ``v3`` (https://github.com/ansible/ansible/pull/80721)

@ -1,2 +0,0 @@
bugfixes:
- unarchive - fix unarchiving sources that are copied to the remote node using a relative temporory directory path (https://github.com/ansible/ansible/issues/80710).

@ -1,4 +0,0 @@
minor_changes:
- Add Python type hints to the Display class (https://github.com/ansible/ansible/issues/80841)
bugfixes:
- vars_prompt - internally convert the ``unsafe`` value to ``bool``

@ -1,4 +0,0 @@
bugfixes:
- "From issue https://github.com/ansible/ansible/issues/80880, when notifying a
handler from another handler, handler notifications must be registered
immediately as the flush_handler call is not recursive."

@ -1,3 +0,0 @@
bugfixes:
- dnf5 - Update dnf5 module to handle API change for setting the download directory
(https://github.com/ansible/ansible/issues/80887)

@ -1,3 +0,0 @@
bugfixes:
- ansible-galaxy - Fix variable type error when installing subdir collections
(https://github.com/ansible/ansible/issues/80943)

@ -1,2 +0,0 @@
bugfixes:
- Fix ``ast`` deprecation warnings for ``Str`` and ``value.s`` when using Python 3.12.

@ -1,2 +0,0 @@
bugfixes:
- distribution facts - fix Source Mage family mapping

@ -1,2 +0,0 @@
bugfixes:
- templating - In the template action and lookup, use local jinja2 environment overlay overrides instead of mutating the templars environment

@ -1,2 +0,0 @@
bugfixes:
- handlers - the ``listen`` keyword can affect only one handler with the same name, the last one defined as it is a case with the ``notify`` keyword (https://github.com/ansible/ansible/issues/81013)

@ -1,2 +0,0 @@
bugfixes:
- "paramiko_ssh, psrp, and ssh connection plugins - ensure that all values for options that should be strings are actually converted to strings (https://github.com/ansible/ansible/pull/81029)."

@ -1,2 +0,0 @@
bugfixes:
- "``ansible.module_utils.service`` - fix inter-process communication in ``daemonize()``"

@ -1,5 +0,0 @@
---
minor_changes:
- Use ``importlib.resources.abc.TraversableResources`` instead of deprecated
``importlib.abc.TraversableResources`` where available
(https:/github.com/ansible/ansible/pull/81082).

@ -1,2 +0,0 @@
minor_changes:
- blockinfile - add append_newline and prepend_newline options (https://github.com/ansible/ansible/issues/80835).

@ -1,2 +0,0 @@
bugfixes:
- Inventory scripts parser not treat exception when getting hostsvar (https://github.com/ansible/ansible/issues/81103)

@ -1,2 +0,0 @@
minor_changes:
- ansible-test - Updated the CloudStack test container to version 1.6.1.

@ -1,2 +0,0 @@
bugfixes:
- pkg_mgr.py - Fix `ansible_pkg_mgr` is unknown in Kylin Linux (https://github.com/ansible/ansible/issues/81332)

@ -1,4 +0,0 @@
bugfixes:
- "ansible-console - fix filtering by collection names when a collection search path was set (https://github.com/ansible/ansible/pull/81450)."
minor_changes:
- "ansible-doc - allow to filter listing of collections and metadata dump by more than one collection (https://github.com/ansible/ansible/pull/81450)."

@ -1,2 +0,0 @@
bugfixes:
- Import ``FILE_ATTRIBUTES`` from ``ansible.module_utils.common.file`` in ``ansible.module_utils.basic`` instead of defining it twice.

@ -1,5 +0,0 @@
minor_changes:
- ansible-galaxy - used to crash out with a "Errno 20 Not a directory" error when extracting files from a role when hitting a file with an illegal name (https://github.com/ansible/ansible/pull/81553). Now it gives a warning identifying the culprit file and the rule violation (e.g., ``my$class.jar`` has a ``$`` in the name) before crashing out, giving the user a chance to remove the invalid file and try again. (https://github.com/ansible/ansible/pull/81555).
known_issues:
- ansible-galaxy - dies in the middle of installing a role when that role contains Java inner classes (files with $ in the file name). This is by design, to exclude temporary or backup files. (https://github.com/ansible/ansible/pull/81553).

@ -1,2 +0,0 @@
bugfixes:
- lib/ansible/utils/encrypt.py - remove unused private ``_LOCK`` (https://github.com/ansible/ansible/issues/81613)

@ -1,2 +0,0 @@
bugfixes:
- Replace uses of ``configparser.ConfigParser.readfp()`` which was removed in Python 3.12 with ``configparser.ConfigParser.read_file()`` (https://github.com/ansible/ansible/issues/81656)

@ -1,2 +0,0 @@
bugfixes:
- "blockinfile - avoid crash with Python 3 if creating the directory fails when ``create=true`` (https://github.com/ansible/ansible/pull/81662)."

@ -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)

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

Loading…
Cancel
Save