diff --git a/lib/ansible/plugins/action/raw.py b/lib/ansible/plugins/action/raw.py index cdafee34c6f..fa0263839f0 100644 --- a/lib/ansible/plugins/action/raw.py +++ b/lib/ansible/plugins/action/raw.py @@ -27,7 +27,7 @@ class ActionModule(ActionBase): if task_vars is None: task_vars = dict() - if self._task.environment: + if self._task.environment and any(self._task.environment) : self._display.warning('raw module does not support the environment keyword') result = super(ActionModule, self).run(tmp, task_vars)