@ -310,11 +310,9 @@ class Block(Base, Become, Conditional, Taggable):
'''
Override for the 'tags' getattr fetcher, used from Base.
environment = self._attributes['tags']
environment = self._attributes['environment']
if environment is None:
environment = dict()
environment = self._get_parent_attribute('environment', extend=True)
return environment
@ -218,6 +218,9 @@ class Task(Base, Conditional, Taggable, Become):
Override post validation of vars on the play, as we don't want to
template these too early.
if value is None:
return dict()
for env_item in value:
if isinstance(env_item, (string_types, AnsibleUnicode)) and env_item in templar._available_variables.keys():
self._display.deprecated("Using bare variables for environment is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{foo}}')")
@ -347,11 +350,9 @@ class Task(Base, Conditional, Taggable, Become):
environment = self._get_parent_attribute('environment')
@ -116,6 +116,8 @@ class ActionBase:
environments = [ environments ]
for environment in environments:
continue
if not isinstance(environment, dict):
raise AnsibleError("environment must be a dictionary, received %s (%s)" % (environment, type(environment)))
# very deliberatly using update here instead of combine_vars, as