* 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)
* 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>
(cherry picked from commit db819d2514)
* 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)
* use declarative FA validation
* deleted redundant/broken imperative validation
* added test case to ensure templating
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit dde10a9afb)
* 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)
* 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)
* 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)
* 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>
(cherry picked from commit ed90a424a9)