Commit graph

55316 commits

Author SHA1 Message Date
Sviatoslav Sydorenko
7328efbdf3 🧪 Replace distlib type ignores with stubs
The stubs are taken from the unmerged PR [[1]] upstream. MyPy is set
up to rely on them instead of the missing package type annotations.

[1]: https://github.com/pypa/distlib/pull/195
2025-12-10 18:03:47 +01:00
Sviatoslav Sydorenko
e05b6e7475 Fix types @ galaxy.collection.galaxy_api_proxy
This includes enforcing `strict_optional` for the
`ansible.galaxy.collection.galaxy_api_proxy` module in MyPy.
2025-12-10 18:03:23 +01:00
Sviatoslav Sydorenko
be8152a2b1 🧪 Fix types @ ansible.galaxy.collection.gpg
Most of this patch is coversion from comments to native syntax. It
also includes fixing a strict optional violation.
2025-12-10 15:57:34 +01:00
FestplattenSchnitzel
e25cc345fe
deb822_repository: add include, exclude parameters (#86171) 2025-12-05 12:21:09 -05:00
Brian Coca
ca6dc93dcc
ansible_local should not trigger deprecation (#86234)
* ansible_local should not trigger deprecation

fixes #86228
2025-12-05 11:35:27 -05:00
sivel / Matt Martz
8a4b184620
fix package installation when specifying architecture without version. Fixes #86156 (#86219) 2025-12-04 11:14:29 -06:00
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
2025-12-03 12:48:19 +01:00
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>
2025-12-02 15:32:24 -06:00
Sviatoslav Sydorenko
251fec31b4 🧪Drop PkgReq stub @ ansible.galaxy.collection
This tiny restructuring allows us to get rid of the type ignore.
2025-12-01 17:41:58 +01:00
lixiaoyong01
cc839f013a
Fix typos in apt_key module (#86257)
Co-authored-by: lixiaoyong <lixiaoyong@kylinos.cn>
2025-11-25 12:09:49 -08:00
John Eismeier
a5a2b77911
Propose fix typo of targetting (#86242)
Signed-off-by: John E <jeis4wpi@outlook.com>
2025-11-25 10:33:31 -05:00
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>
2025-11-25 10:14:05 -05:00
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>
2025-11-25 10:04:29 -05:00
sivel / Matt Martz
6bb7bd760f
Fix escaping issue in ansiballz wrapper for sitecustomize (#86236)
* Fix escaping issue in ansiballz wrapper for sitecustomize

* add clog frag
2025-11-24 09:33:45 -08:00
sivel / Matt Martz
bff3a9aeb9
Fix docker hostname parsing in ansible-test (#86235)
* Fix docker hostname parsing in ansible-test

* add clog frag
2025-11-20 15:54:33 -08:00
Martin Krizek
9d9a8d78ee
Skip hostname integration tests on all container providers (#86227)
* Skip hostname integration tests on all container providers

* Use skip/docker instead
2025-11-20 09:53:49 -08:00
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>
2025-11-20 12:32:32 -05:00
Matt Clay
ce84d3157d
Fix first_found example (#86224) 2025-11-19 10:16:45 -08:00
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.
2025-11-19 09:14:21 -08:00
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>
2025-11-18 20:04:22 -05:00
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>
2025-11-17 15:29:43 -08:00
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>
2025-11-17 15:27:24 -08:00
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>
2025-11-14 10:20:50 -08:00
Matt Clay
3d26431e4f
ansible-test - Improve AZP commit API error handling (#86197) 2025-11-14 03:59:26 +00:00
🇺🇦 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
2025-11-13 17:48:35 +00:00
biancalana
eb0ada3d28
Feature/improve bhyve guest and host detection (#85767) 2025-11-13 09:18:00 -05:00
David Shrewsbury
dc3cc0f9ea
Fix test_encrypt.py unit test (#86180) 2025-11-12 09:54:25 -05:00
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.
2025-11-11 17:33:45 -05:00
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.
2025-11-11 17:29:10 -05:00
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>
2025-11-11 11:50:36 -08:00
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>
2025-11-11 09:13:15 -08:00
Matt Clay
76f07034b3
Fix unit test serialization (#86163)
This allows the test to work on pytest 9+
2025-11-10 16:29:20 -08:00
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>
2025-11-10 09:16:54 -08:00
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>
2025-11-07 10:54:25 -05:00
Matt Clay
4184d9665e
Fix getuser fallback error handling (#86144) 2025-11-07 01:57:23 +00:00
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>
2025-11-06 15:08:54 -06:00
David Shrewsbury
e3cff24134
Increase code coverage of utils/encrypt.py (#86060)
* Add encryption code coverage

Co-authored-by: Matt Clay <matt@mystile.com>
2025-11-06 15:26:41 -05:00
Matt Clay
a4ae978122
template module - Report syntax error line number (#86101)
Report the line number for Jinja syntax errors in template files.
2025-11-05 17:11:17 -08:00
Matt Clay
8ac5c8580b
Remove urllib2 pylint check (#86139)
No supported Python version provides urllib2.
2025-11-06 00:55:32 +00:00
Matt Clay
5b8ae0b5b5
Fix deprecation comments (#86138) 2025-11-06 00:53:41 +00:00
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
2025-11-05 13:25:49 -05:00
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
2025-11-04 15:34:08 -08:00
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>
2025-11-04 10:52:15 -05:00
Martin Krizek
f743dfce93
basic.py: add proper deprecations (#86064)
* basic.py: add proper deprecations

* fix sanity
2025-11-04 10:19:15 -05:00
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>
2025-11-04 03:33:31 +00:00
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>
2025-11-04 13:25:03 +10:00
Matt Davis
3c5bb535a9
Fix incorrect propagation of task.connection (#86121)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-11-03 21:17:43 +00:00
Brian Coca
5904846342
config lookup, remove unreachable code (#86051)
defensive, but uneeded since get_option already precludes bad values
this far in
2025-11-03 10:35:08 -05:00
🇺🇦 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>
2025-10-30 16:48:46 +01:00
Matt Clay
13496b9e11
ansible-test - Fix integration test code coverage (#86100) 2025-10-29 18:21:53 -07:00