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

Preserve original variables when using a loop #59417

Closed
wants to merge 1 commit into from

Conversation

jborean93
Copy link
Contributor

@jborean93 jborean93 commented Jul 23, 2019

SUMMARY

The fix in #59024 resulted in any task variables defined that were used in the connection/shell/become options would no longer be defined in future loop iterations. This is an alternative way to solve #58876 by taking a copy of the variables before they are modified by self._play_context.update_vars(variables) ensuring future loop iterations will still honour the task directive value.

This could be a potential memory issue so will need others to chime in.

Fixes #59414

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

task_executor

@jborean93 jborean93 requested review from bcoca and mkrizek July 23, 2019 03:01
@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Jul 23, 2019
@mkrizek
Copy link
Contributor

mkrizek commented Jul 23, 2019

Possible alternative #59426

@jborean93
Copy link
Contributor Author

Closing in favour of 59426

@jborean93 jborean93 closed this Jul 23, 2019
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Jul 23, 2019
@ansible ansible locked and limited conversation to collaborators Aug 21, 2019
@jborean93 jborean93 deleted the loop-task-var branch September 24, 2019 12:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

connection/shell/become vars are removed when in a loop
4 participants