Commit Graph
4463 Commits
Author SHA1 Message Date
Matt DavisandGitHub cd95e0ff4b New release v2.19.3rc1 (#85923) 2025-09-29 22:11:25 +00:00
Brian CocaandGitHub 06900bbbac script inventory plugin correct error message (#85765) (#85868)
type was reflecting 'converted' type, not 'pre conversion' of the data
now message points at specific data keys
add deprecation tests

(cherry picked from commit c87dc6ed7d)
2025-09-29 13:19:39 -07:00
Sloane HertelandGitHub 3f7210d00a Fix ansible-doc -l/-F/--metadata-dump for relative imports in filter/test plugins (#85801) (#85860)
* 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

(cherry picked from commit 5e8815b823)
2025-09-29 13:16:30 -07:00
Jordan BoreanandGitHub 60fe03290f Windows async - handle trailing junk output (#85820) (#85829)
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.

(cherry picked from commit aad9fbd4f5)
2025-09-29 13:15:24 -07:00
Abhijeet KasurdeandGitHub d09ee36b8f [stable-2.19] fetch_file: add ca_path and cookies parameters (#85187) (#85821)
* 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
(cherry picked from commit 1cd4369)

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-09-29 13:14:05 -07:00
a7eee1536f [stable-2.19] Prevent IO capture hang/loss in basic.run_command (#85869) (#85891)
* 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

---------
(cherry picked from commit 79ddee1)

Co-authored-by: Chris Meyers <chrismeyersfsu@users.noreply.github.com>
Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2025-09-23 14:59:28 -05:00
Matt ClayandGitHub 423032930b [stable-2.19] Move display internals into _internal (#85889) (#85896)
(cherry picked from commit 58bad71859)
2025-09-22 17:56:17 -07:00
Matt ClayandGitHub ca99cc7e55 New release v2.19.2 (#85822) 2025-09-08 18:08:07 +00:00
Matt DavisandGitHub 24c92b2d24 New release v2.19.2rc1 (#85788) 2025-09-02 17:09:11 -07:00
Martin KrizekandGitHub 764070de69 [stable-2.19] Expose ansible_failed_task in rescue for explicit flush_handlers (#85687) (#85707)
Fixes #85682

(cherry picked from commit c5ddc93767)
2025-09-02 16:20:30 -07:00
Martin KrizekandGitHub 9aea625f63 [stable-2.19] ternary: evaluate values lazily (#85752) (#85753)
Fixes #85743
(cherry picked from commit 6976e13075)
2025-09-02 16:06:43 -07:00
Matt ClayandGitHub f2a4eb74ec [stable-2.19] ansible-test - Update Ansible Core CI auth (#85717) (#85768)
Implement new authentication methods for accessing the Ansible Core CI service.

(cherry picked from commit be9e57366b)
2025-08-29 21:00:18 -07:00
Matt MartzandGitHub 43cac0b1d2 New release v2.19.1 (#85730) 2025-08-25 14:16:05 -05:00
Matt DavisandGitHub 7fc339e4aa New release v2.19.1rc1 (#85698) 2025-08-18 23:53:04 +00:00
875b258977 Include result origin in broken conditional message instead of result (#85695) (#85697)
(cherry picked from commit b1fc98c8ad)

Co-authored-by: Matt Clay <matt@mystile.com>
2025-08-18 23:16:56 +00:00
Abhijeet KasurdeandGitHub 8849bd776b [stable-2.19] service_facts: Handle KeyError while processing service name (#85572) (#85647)
* 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
(cherry picked from commit 9ed7164)

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-08-18 15:34:42 -07:00
8d26bbf3f7 [stable-2.19] Fix marker handling in templating (#85690) (#85694)
* allow markers to pass through template lookup
* avoid tripping markers within Jinja generated code

(cherry picked from commit 558676fcdc)

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2025-08-18 21:20:37 +00:00
a00261b0ec [stable-2.19] ensure undefined marker access on Jinja getattr->getitem fallback (#85688) (#85691)
(cherry picked from commit 3518d48146)

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2025-08-18 20:41:14 +00:00
Sloane HertelandGitHub 6404fdce45 Fix nested import_tasks when the parent import contains a template (#85599) (#85636)
* Test nested import_tasks when the parent import contains a template

* Fix templating the parent_include.args

(cherry picked from commit 9a6420e1d5)
2025-08-18 10:00:15 -07:00
Matt DavisandGitHub 2dcd35b692 [stable-2.19] Backward-compatible None handling in template concat and argspec str (#85652) (#85663)
* 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

(cherry picked from commit e3c9908679)

* 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

(cherry picked from commit 5345ac9911)
2025-08-18 09:58:32 -07:00
Matt ClayandGitHub 3c1e46435b [stable-2.19] Fix slicing of tuples in templating (#85608) (#85661)
* Fix slicing of tuples in templating

* Improve lazy container test coverage
(cherry picked from commit 00fe38215c)
2025-08-15 12:24:39 -07:00
Matt ClayandGitHub 0718473815 [stable-2.19] Fix filter plugin result processing (#85653) (#85662)
(cherry picked from commit 76748b8478)
2025-08-15 12:22:27 -07:00
db4973572a Add temporary module result serialization hook (#85609) (#85621)
* Add temporary module result serialization hook

* Sanity test fix

---------


(cherry picked from commit faf86ca2b3)

Co-authored-by: Matt Clay <matt@mystile.com>
2025-08-05 14:12:47 -05:00
5a20b991d4 Rewrite exception key on failed_when: false (#85516) (#85517)
* Prevents callback handle_exception from displaying the captured exception when the task is not failed.
* Added tests.


(cherry picked from commit 2fbd7c114e)

Co-authored-by: Matt Clay <matt@mystile.com>
2025-08-04 10:13:42 -05:00
Brian CocaandGitHub 68378c85cb plugin config options are now correctly fetched with origin (#85488) (#85525)
* also update callbcacks, since they override these functions
due to backwards compat _options being taken for CLI

(cherry picked from commit 19f9c66004)
2025-08-04 10:13:32 -05:00
Abhijeet KasurdeandGitHub e8272f1038 [stable-2.19] filter: update integration tests (#84990) (#85540)
(cherry picked from commit 181dbdb)

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-08-04 10:13:12 -05:00
Matt ClayandGitHub a5cc030818 [stable-2.19] ansible-test - Limit bootstrap package install retries (#85544) (#85546)
(cherry picked from commit ee297bb7ca)
2025-07-29 15:23:56 -07:00
85af5cadf3 [stable-2.19] tqm: Use correct warning methods (#85434) (#85550)
* Use display.error_as_warning instead of self.warning
* Use display.error_as_warning instead of display.warning_as_error.

(cherry picked from commit ea238c9eb5)

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-07-29 15:23:34 -07:00
Matt ClayandGitHub f28faa7fbf [stable-2.19] ansible-test - Fix coverage config (#85555) (#85559)
(cherry picked from commit 35830cb054)
2025-07-29 15:22:57 -07:00
Matt ClayandGitHub 72c3a20e1a [stable-2.19] ansible-test - Use OS packages on FreeBSD 13.5 (#85530) (#85531)
(cherry picked from commit cdb7af094b)
2025-07-23 22:43:22 +00:00
Matt DavisandGitHub 82529e534d New release v2.19.0 (#85513) 2025-07-21 10:43:25 -07:00
Matt DavisandGitHub b429f84674 New release v2.19.0rc2 (#85456) 2025-07-08 16:35:22 -07:00
Matt DavisandGitHub 8711bd0bf0 add missing changelog deprecation entries (#85415) 2025-07-01 17:43:14 +00:00
Matt ClayandGitHub 139b567cab New release v2.19.0rc1 (#85403) 2025-06-30 21:59:56 +00:00
Sloane HertelandMatt Clay 98fd931629 Remove deprecation warning caused by automatic role argument spec validation (#85401)
(cherry picked from commit 7216e04139)
2025-06-30 12:21:09 -07:00
Martin KrizekandMatt Clay 16999ea4d9 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>
(cherry picked from commit 54ccad9e46)
2025-06-30 12:21:09 -07:00
Matt DavisandMatt Clay b23aa84a49 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>
(cherry picked from commit 11f5563895)
2025-06-30 12:21:09 -07:00
Matt ClayandGitHub c0d8306d4e New release v2.19.0b7 (#85383) 2025-06-24 22:57:36 +00:00
Matt DavisandMatt Clay b3dde82ab1 deprecate esoteric/undocumented playbook syntaxes (#85378)
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 547c64f326)
2025-06-24 15:18:17 -07:00
Matt DavisandMatt Clay 0ce6b45db2 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>
(cherry picked from commit 3c52b14c9e)
2025-06-24 15:18:17 -07:00
Nils BrinkmannandMatt Clay 223546bf76 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>
(cherry picked from commit 578d25f286)
2025-06-24 15:18:17 -07:00
Matt DavisandMatt Clay 9f7432c5ff display wrap/format arg cleanup (#85352)
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit fa9f286096)
2025-06-24 15:18:16 -07:00
Matt DavisandMatt Clay 03dc8c4260 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>
(cherry picked from commit 46abcfcc82)
2025-06-24 15:18:16 -07:00
Sloane HertelandMatt Clay 39ed1fc4bc 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>
(cherry picked from commit 8e9f5fb9d5)
2025-06-24 15:18:16 -07:00
Matt Clay b6ac61b487 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

(cherry picked from commit d922398c4d)
2025-06-24 15:18:16 -07:00
Matt Clay 0aa8a878cf Spelling fixes (#85345)
A few grammar fixes too.

(cherry picked from commit 83fcaeaa8b)
2025-06-24 15:18:16 -07:00
Matt DavisandMatt Clay 59cdb65926 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>
(cherry picked from commit eec57ec396)
2025-06-24 15:18:16 -07:00
Matt Clay fd8d22e874 ansible-test - Fix relative import resolution (#85328)
(cherry picked from commit 093ac8df2d)
2025-06-24 15:18:16 -07:00
Abhijeet KasurdeandMatt Clay 73df36e7d0 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>
(cherry picked from commit cace19f365)
2025-06-24 15:18:16 -07:00
Matt Clay 865d69dab1 ansible-test - Add remote debugging support (#85317)
(cherry picked from commit 7ef13cb29e)
2025-06-24 15:18:16 -07:00