Skip to content
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

Add do as a dynamic version of block. #7

Open
wants to merge 2 commits into
base: updox-2.8.5
Choose a base branch
from

Conversation

estheruary
Copy link

@estheruary estheruary commented Oct 29, 2020

This is a big one but is a source of personal annoyance for me. This patch creates do as the dynamic equivalent of block. Some examples.

# You can loop over blocks!
- name: Loop over multiple tasks.
  do:
    - debug: msg=hello
    - debug: var=item
  loop: [1, 2, 3]
# What's different in this case is that it's not expanded by applying the when clause to each task. 
# With `block` you would see two skipped tasks while with this you will see one skipped `do`.
#
- name: Skip multiple tasks as a unit.
  do:
    - debug: msg="run a task"

    - debug: msg="run another task"
  when: condition

Spiritually block is an inline import, do is an inline include.

@estheruary estheruary force-pushed the ud-add-dynamic-blocks branch from e90d08e to eeb4f7e Compare October 29, 2020 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant