* 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
---------
(cherry picked from commit 335db20951)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
* GNU digest line may contain multiple spaces between
checksum and filename. Fix regex to handle this situation.
Fixes: #86132
(cherry picked from commit af9009b)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
* 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).
(cherry picked from commit 15e9f51e2d)
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>
(cherry picked from commit 1cb2932c95)
* 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.
(cherry picked from commit 99bb587906)
* Update win_exec_wrapper integration test to match #86029 (#86052)
* Remove assertion now that there is no warning
(cherry picked from commit df34bf9e70)
---------
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
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.
(cherry picked from commit 05d5b0f168)
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)
* 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)
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)
* 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>
* 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)
* 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>
* also update callbcacks, since they override these functions
due to backwards compat _options being taken for CLI
(cherry picked from commit 19f9c66004)
* 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
---------
(cherry picked from commit 3882366585)
Co-authored-by: Jordan Borean <jborean93@gmail.com>
* Ensure config env/ini values are tagged
Config env and ini values now have origin and trust tags applied.
* Remove unused import
(cherry picked from commit 6ff6339191)
* 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
(cherry picked from commit d6efb7db8a)
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
* 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)
* 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>
(cherry picked from commit 73369f53af)
* 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>
(cherry picked from commit 29cdba1fee)