* 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)
When using static string to search system log, avoid matching self execution
logged by Ansible by default.
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 137036e96f)
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)
* 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)
* 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)
* 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)
* 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)
* 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)