1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Don't re-inject become* variables as it causes problems when templating is involved

Prior to 75b6f61, we strictly limited variables we re-injected. After that
patch however, we re-injected everything which causes problems under certain
circumstances. For now, we'll continue to filter out some properties of
PlayContext for re-injection.

Fixes #14352
This commit is contained in:
James Cammarata 2016-02-22 17:09:58 -05:00
parent 283532e11d
commit 078ebb0dec

View file

@ -513,8 +513,14 @@ class PlayContext(Base):
''' '''
for prop, var_list in MAGIC_VARIABLE_MAPPING.items(): for prop, var_list in MAGIC_VARIABLE_MAPPING.items():
var_val = getattr(self, prop, None) try:
if var_val is not None: if 'become' in prop:
continue
var_val = getattr(self, prop)
for var_opt in var_list: for var_opt in var_list:
if var_opt not in variables: if var_opt not in variables:
variables[var_opt] = var_val variables[var_opt] = var_val
except AttributeError:
continue