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

Saving variable expressions for reuse #3460

Closed
mpdehaan opened this issue Jul 7, 2013 · 1 comment
Closed

Saving variable expressions for reuse #3460

mpdehaan opened this issue Jul 7, 2013 · 1 comment
Labels
bug This issue/PR relates to a bug.

Comments

@mpdehaan
Copy link
Contributor

mpdehaan commented Jul 7, 2013

Here is a behavior we might have lost in 1.2 that someone was asking about on the list. We should fix this for 1.3 if we find out it's a problem.

vars:
    this_is_a_test: 2 == 3

tasks:
    - debug: msg = foo
      when: "{{ this_is_a_test }}"

When the when expression contains $ or "{{" the system should try to template the line one extra time before evaluating.

@mpdehaan
Copy link
Contributor Author

This was fixed this morning on the development branch.

You can also say:

when: variable_name

robinro pushed a commit to robinro/ansible that referenced this issue Dec 9, 2016
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants