-
Notifications
You must be signed in to change notification settings - Fork 19
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
Ansible loop interface redesign #140
Comments
for the for example, if a module
Is this module a candidate for What would be the recommendation from Ansible? |
actually, that is one i'm now partial to dropping (i really just pasted pretty old proposal) .. squashing should not be needed, people should just pass the list directly to fields for modules that support it. |
one thing the current Even the patch is simple:
so now you could do: - debug: var=item
loop: test
vars:
test: [1,2,3] |
Integration tests for currently supported interaction between |
@caphrim007 For squashing and pure functionality, we still have this one open: #71 |
(ansible 2.9.6) FWIW, the task below
gives (abridged)
|
Ref #44741 Ref ansible/proposals#140 * Replace select filter with a more portable thing * Add context This is needed for split controller/remote Co-authored-by: Sam Doran <sdoran@redhat.com>
Ref ansible#44741 Ref ansible/proposals#140 * Replace select filter with a more portable thing * Add context This is needed for split controller/remote Co-authored-by: Sam Doran <sdoran@redhat.com>
Ref ansible#44741 Ref ansible/proposals#140 * Replace select filter with a more portable thing * Add context This is needed for split controller/remote Co-authored-by: Sam Doran <sdoran@redhat.com>
Ref ansible#44741 Ref ansible/proposals#140 * Replace select filter with a more portable thing * Add context This is needed for split controller/remote Co-authored-by: Sam Doran <sdoran@redhat.com>
Proposal: future loops
Author: Brian Coca <@bcoca> IRC: bcoca
Date: 2016-02-32
Motivation
Current
with_
loops are misleading and have much magic that confuses users and obfuscates what really goes on.The until/retry keywords are 'also loops' and don't interact well with
with_
loops.Problems
execution)
{{ }}
Jinja2 to disambiguate between strings and variables .. due to 'auto flatten' abovewas worse before when we allowed 'naked' Jinja2 and you could not give errors on missing var as it could be meant as string.
Solution proposal
Redesign loop syntax (names not final, feel free to bikeshed)
The terms
result is failed
possibly make a boolean and then let 'when condition' get a retries value to decide end. default to 0 (currently we have 3 but only if until: is defined)
OPTIONAL
This would give a cleaner and clearer interface for all looping needs as well as unify the until/retry and 'list looping' into one
structure and hopefully do the same in execution so they can work together intelligently.
A lot of this is base on feedback for ansible/ansible#12086, some we are implementing already in other wa
ys.
The text was updated successfully, but these errors were encountered: