Correct logic around determining environment variable existence
Fixes #13105
This commit is contained in:
parent
c753ae6e22
commit
09994c18f3
1 changed files with 5 additions and 4 deletions
|
@ -329,7 +329,8 @@ class VariableManager:
|
|||
|
||||
# special case for the 'environment' magic variable, as someone
|
||||
# may have set it as a variable and we don't want to stomp on it
|
||||
if task and 'environment' not in all_vars:
|
||||
if task:
|
||||
if 'environment' not in all_vars:
|
||||
all_vars['environment'] = task.environment
|
||||
else:
|
||||
display.warning("The variable 'environment' appears to be used already, which is also used internally for environment variables set on the task/block/play. You should use a different variable name to avoid conflicts with this internal variable")
|
||||
|
|
Loading…
Reference in a new issue