-
Notifications
You must be signed in to change notification settings - Fork 24k
[POC] Add projection feature for registering vars - Option 2 #72553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
Added support for using |
The test
|
Is there a chance this will get added to the project? Seems like this has been floating around for a couple of years now. |
Yes, there is a chance. This feature has been included in the experimental fallible (https://pypi.org/project/fallible/) build, and we are waiting on feedback about the feature, to determine if it should be included within ansible-core. See this presentation for more information: https://youtu.be/DCf_e6XRsCw?t=7924 So far, feedback has been limited, and I don't have any specific indication whether anyone has actually tried the feature within the above fallible build or not. |
SUMMARY
This PoC PR updates
register
to allow authors to pre-process module return results, before registering the variables.In extension, this allows registering multiple variables
See:
register
expressions for dict specs #67804ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
Either
ansible_result
must be used in the projection, and represents the task result, all normal jinja follows.This PR also adds implicit registers named
ansible_loop_result
andansible_result
.ansible_loop_result
will only exist during a looped task, andansible_result
will only exist when not on a looped task. These variables do not persist outside of theTaskExecutor
so are only useful forwhen
,changed_when
,failed_when
,until
.DOCS:
Since docs are no longer maintained in this repo, the docs for this can be located at https://gist.github.com/sivel/376abb3ae5476cfe168361d5ae556f61
TODO:
_project
off of TE for access in the Strategy also, to deduplicate code.
as the first character for a projection