Commit Graph
55099 Commits
Author SHA1 Message Date
Matt DavisandGitHub 8a047b623d New release v2.19.0b6 (#85305) v2.19.0b6 2025-06-11 22:30:33 +00:00
Brian CocaandMatt Davis d3f2c6d8f0 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>
(cherry picked from commit 7e495f4b20)
2025-06-11 14:53:10 -07:00
leopardracerandMatt Davis 529776f0a1 Fix typos in documentation and test ignore list (#85303)
* Update ignore.txt

* Update invalid_choice_value.py

(cherry picked from commit 56de597fc7)
2025-06-11 14:53:10 -07:00
Matt ClayandMatt Davis f2a0eef867 Fix bool filter for non-hashable types (#85300)
(cherry picked from commit c8324aa01a)
2025-06-11 14:53:10 -07:00
Sloane HertelandMatt Davis 58496bed29 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>
(cherry picked from commit d3977ebc88)
2025-06-11 14:53:10 -07:00
Martin KrizekandMatt Davis 96b97dee7c module_utils/basic.py: properly deprecate importing text_type (#85293)
(cherry picked from commit 2cfb158536)
2025-06-11 14:53:10 -07:00
Matt ClayandMatt Davis 1fe0fb0e7a ansible-test - Code cleanup (#85297)
(cherry picked from commit bdc6c8e16a)
2025-06-11 14:53:10 -07:00
Matt DavisandMatt Davis 7a7427bd6f Fix post-fork deadlock from early Python writers like pydevd (#85296)
(cherry picked from commit 1d1bbe3424)
2025-06-11 14:53:10 -07:00
Matt ClayandMatt Davis b5a4fe62ed Fix nested include with templating (#85295)
(cherry picked from commit 714f796384)
2025-06-11 14:53:10 -07:00
Matt ClayandMatt Davis 0cecfd9877 AnsiballZ refactoring and remote debug support (#85289)
(cherry picked from commit 45dd2c0647)
2025-06-11 14:53:10 -07:00
David ShrewsburyandMatt Davis e2b831ce26 get_url - check for incomplete data read (#85164)
(cherry picked from commit aa8d58a174)
2025-06-11 14:53:10 -07:00
Martin KrizekandMatt Davis 33c55b9c25 Fix templating tags on plays and roles (#82314)
Fixes #69903

ci_complete

(cherry picked from commit 532edf4c35)
2025-06-11 14:53:10 -07:00
Matt ClayandMatt Davis aae5734e0e Fix deprecation versions in template lookup (#85288)
(cherry picked from commit 4956619ac2)
2025-06-11 14:53:10 -07:00
Matt DavisandMatt Davis b95bc19853 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>
(cherry picked from commit 2bed98bd20)
2025-06-11 14:53:10 -07:00
Martin KrizekandMatt Davis eb29a662f6 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>
(cherry picked from commit 600c1e67b4)
2025-06-11 14:53:10 -07:00
Matt DavisandMatt Davis 0f2bc31753 adjust PluginInfo to use PluginType enum (#85277)
* normalization fixups

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 43c0132caa)
2025-06-11 14:53:10 -07:00
Matt DavisandMatt Davis 7b823720ca 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

(cherry picked from commit 9f0a8075e3)
2025-06-11 14:53:10 -07:00
Matt DavisandMatt Davis a943626ce6 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>
(cherry picked from commit 2b7204527b)
2025-06-11 14:53:10 -07:00
Martin KrizekandMatt Davis 9f703f7633 Fix calls to deprecated() to include help_text arg (#85262)
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit ea7ad90c31)
2025-06-11 14:53:10 -07:00
Matt ClayandMatt Davis 36f322bb2c Add missing docs for sftp_batch_mode (#85270)
(cherry picked from commit 051f7e5944)
2025-06-11 14:53:10 -07:00
Matt ClayandMatt Davis a57229aa8a 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>
(cherry picked from commit 1c06c46cc1)
2025-06-11 14:53:10 -07:00
Matt DavisandMatt Davis bc624d35b9 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>
(cherry picked from commit 6198c7377f)
2025-06-11 14:53:10 -07:00
Matt ClayandMatt Davis 2eb107fe1f 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>
(cherry picked from commit 7da24ca7b0)
2025-06-11 14:53:10 -07:00
Aditya PuttaandMatt Davis d5e6d31d50 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>
(cherry picked from commit 0bbd8847c4)
2025-06-11 14:53:10 -07:00
Matt DavisandGitHub 92824444ea Update Ansible release version to v2.19.0b5.post0. (#85257) 2025-06-04 00:18:49 +00:00
Matt DavisandGitHub c79c2710f4 New release v2.19.0b5 (#85255) v2.19.0b5 2025-06-03 16:43:05 -07:00
Matt DavisandMatt Davis 3a487532dd 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>
(cherry picked from commit bbbfbd57e2)
2025-06-03 15:49:23 -07:00
Martin KrizekandMatt Davis 20be3951b7 Deprecate ShellModule.checksum() (#85216)
The methods have not been used, updated or tested since
b9d0662faf.

(cherry picked from commit d7c4d0119f)
2025-06-03 15:49:23 -07:00
Matt DavisandMatt Davis e1a7508f6d 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>
(cherry picked from commit df0b417f2d)
2025-06-03 15:49:23 -07:00
Jordan BoreanandMatt Davis 4ae5800849 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>
(cherry picked from commit 8f2622c39f)
2025-06-03 15:49:23 -07:00
Martin KrizekandMatt Davis 603e65d204 Merge dnf and dnf5 integration tests (#85199)
(cherry picked from commit 01bb9393d7)
2025-06-03 15:49:23 -07:00
Martin KrizekandMatt Davis a8c68be3b9 Deprecate ansible.compat.importlib_resources (#85226)
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 3505572470)
2025-06-03 15:49:23 -07:00
Martin KrizekandMatt Davis 744f86fbc5 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>
(cherry picked from commit 487d699226)
2025-06-03 15:49:23 -07:00
Jordan BoreanandMatt Davis 698b8d64fc Exclude ansible._protomatter from ansible-doc output by default (#85115)
* Exclude ansible._protomatter from ansible-doc output by default

* Added changelog

(cherry picked from commit b4741fc495)
2025-06-03 15:49:23 -07:00
Matt DavisandMatt Davis 7b99b0144d local connection always passes str to Popen (#85239)
(cherry picked from commit 0ee1c36779)
2025-06-03 15:49:23 -07:00
Matt DavisandMatt Davis d63f9aa38d 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>
(cherry picked from commit 2a24633964)
2025-06-03 15:49:23 -07:00
Matt ClayandMatt Davis 0576ff3e65 Add missing warning methods and args (#85225)
(cherry picked from commit eafe5fc739)
2025-06-03 15:49:23 -07:00
Matt DavisandMatt Davis 85283e7238 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>
(cherry picked from commit cbcefc53a3)
2025-06-03 15:49:23 -07:00
Brian CocaandMatt Davis 311ef75245 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>
(cherry picked from commit d41a3430b7)
2025-06-03 15:49:23 -07:00
Martin KrizekandMatt Davis 0d01da2dc2 jinja2.__version__ is deprecated (#85221)
Prepare for its removal in Jinja 3.3.

See https://github.com/pallets/jinja/pull/2098

(cherry picked from commit 0e2f770a24)
2025-06-03 15:49:23 -07:00
Matt DavisandMatt Davis 5fd78b07fb 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>
(cherry picked from commit 91453e30af)
2025-06-03 15:49:23 -07:00
Matt ClayandMatt Davis 8b0b54de38 ansible-test - Fix incorrect use of InferenceContext (#85230)
(cherry picked from commit e2a5377b9a)
2025-06-03 15:49:23 -07:00
Matt DavisandMatt Davis 21f478e77b Decouple SSH client verbosity from Ansible display (#85224)
* decouple SSH client verbosity from Ansible display

* remove failing false-coverage unit test

(cherry picked from commit b71d9aa4a5)
2025-06-03 15:49:23 -07:00
Matt DavisandMatt Davis 40a675543f 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

(cherry picked from commit 356bf336bd)
2025-06-03 15:49:23 -07:00
Harshvardhan SharmaandMatt Davis fa2f1e4750 Improve SUSE distribution detection using VARIANT_ID with fallback (#85152)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit f05b1d1ccf)
2025-06-03 15:49:23 -07:00
Martin KrizekandMatt Davis 2adc8ae1cd dnf5 - handle all specific libdnf5 exceptions (#85175)
Fixes #84634

(cherry picked from commit 99a3346de6)
2025-06-03 15:49:23 -07:00
Martin KrizekandMatt Davis 6f7215ca36 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.

(cherry picked from commit a0132fec0b)
2025-06-03 15:49:23 -07:00
Kimmo SuominenandMatt Davis 43b0155529 Recognize virtualization type correctly on Linode (#85184)
(cherry picked from commit 3b66150cc3)
2025-06-03 15:49:23 -07:00
Abhijeet KasurdeandMatt Davis 2d800e1a4c service: Remove py2 specific code (#85191)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
(cherry picked from commit 068157618c)
2025-06-03 15:49:23 -07:00
Martin KrizekandMatt Davis df60504b93 apt_repository: remove Python 2 support (#85212)
(cherry picked from commit f635a22d81)
2025-06-03 15:49:23 -07:00