@ -244,11 +244,21 @@ class Task(Base, Conditional, Taggable, Become):
if value is None :
if value is None :
return dict ( )
return dict ( )
for env_item in value :
elif isinstance ( value , list ) :
if isinstance ( env_item , ( string_types , AnsibleUnicode ) ) and env_item in templar . _available_variables . keys ( ) :
if len ( value ) == 1 :
display . deprecated ( " Using bare variables for environment is deprecated. "
return templar . template ( value [ 0 ] , convert_bare = True )
" Update your playbooks so that the environment value uses the full variable syntax ( ' {{ foo}} ' ) " )
else :
break
env = [ ]
for env_item in value :
if isinstance ( env_item , ( string_types , AnsibleUnicode ) ) and env_item in templar . _available_variables . keys ( ) :
env [ env_item ] = templar . template ( env_item , convert_bare = True )
elif isinstance ( value , dict ) :
env = dict ( )
for env_item in value :
if isinstance ( env_item , ( string_types , AnsibleUnicode ) ) and env_item in templar . _available_variables . keys ( ) :
env [ env_item ] = templar . template ( value [ env_item ] , convert_bare = True )
# at this point it should be a simple string
return templar . template ( value , convert_bare = True )
return templar . template ( value , convert_bare = True )
def _post_validate_changed_when ( self , attr , value , templar ) :
def _post_validate_changed_when ( self , attr , value , templar ) :