Skip to content

[POC] Support unpacking loop vars - #74259

Draft
sivel wants to merge 1 commit into
ansible:develfrom
sivel:issue/67161
Draft

sivel wants to merge 1 commit into
ansible:develfrom
sivel:issue/67161

Conversation

@sivel

@sivel sivel commented Apr 13, 2021 •

Copy link
Copy Markdown
Member
SUMMARY

This PR injects the loop items directly into the "global" scope of task vars, while also keeping it available under loop_var

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

lib/ansible/executor/task_executor.py

ADDITIONAL INFORMATION
- name: TEST LOOP CONTROL LABEL
  hosts: localhost
  gather_facts: no
  tasks:
    - debug: var=foo
      loop:
        - foo: bar
        - foo: baz
        - foo: qux
      loop_control:
        unpack: true

TODO:

  • Probably need to validate the type of the var to ensure it is a mapping when unpack=True

@ansibot ansibot added WIP affects_2.12 feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. labels Apr 13, 2021
@sivel sivel changed the title [POC] Support spreading loop vars [POC] Support spreading/unpacking loop vars Apr 15, 2021
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Apr 15, 2021
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 23, 2021
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 22, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 30, 2022
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Jun 18, 2022
@sivel sivel added the fallible This issue/PR is a candidate for fallible label Sep 1, 2022
@sivel sivel changed the title [POC] Support spreading/unpacking loop vars [POC] Support unpacking loop vars Sep 7, 2022
@ansibot ansibot removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Sep 7, 2022
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Sep 15, 2022
@ansibot ansibot removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Sep 21, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 29, 2022
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 17, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 25, 2022
@djdanielsson

Copy link
Copy Markdown

is there any status on if this PR will be accepted? This seems like a great feature to offer

@sivel

sivel commented Jan 9, 2023

Copy link
Copy Markdown
Member Author

is there any status on if this PR will be accepted? This seems like a great feature to offer

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

@djdanielsson

Copy link
Copy Markdown

Yes I know about that, where are you looking for feedback? In this PR or somewhere else?

@sivel

sivel commented Jan 9, 2023

Copy link
Copy Markdown
Member Author

Yes I know about that, where are you looking for feedback? In this PR or somewhere else?

Feedback should be provided on the individual PRs. In this case, right here is expected.

@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Feb 28, 2023
@ansibot ansibot removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Mar 30, 2023
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 12, 2023
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Apr 20, 2023
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Oct 24, 2023
@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Jun 12, 2024
@ansibot

ansibot commented Jun 12, 2024

Copy link
Copy Markdown
Contributor

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/executor/task_executor.py:301:40: undefined-variable: Undefined variable 'Mapping'

click here for bot help

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jun 26, 2024
@ansibot ansibot added the stale_pr This PR has not been pushed to for more than one year. label Jun 17, 2025
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Apr 7, 2026
@ansibot ansibot removed WIP labels Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects_2.12 ci_verified Changes made in this PR are causing tests to fail. fallible This issue/PR is a candidate for fallible feature This issue/PR relates to a feature request. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_pr This PR has not been pushed to for more than one year.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants