mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Change the raw module's detection of environment settings. (#15535)
The task_vars datastructure always contains an environment key, so use the _task.environment property to look for a non-empty list instead.
This commit is contained in:
@@ -26,11 +26,9 @@ class ActionModule(ActionBase):
|
|||||||
def run(self, tmp=None, task_vars=None):
|
def run(self, tmp=None, task_vars=None):
|
||||||
if task_vars is None:
|
if task_vars is None:
|
||||||
task_vars = dict()
|
task_vars = dict()
|
||||||
else:
|
|
||||||
if 'vars' in task_vars:
|
if self._task.environment:
|
||||||
if 'environment' in task_vars['vars']:
|
self._display.warning('raw module does not support the environment keyword')
|
||||||
# The environment key only exists if explicitly declared in the task or in the play
|
|
||||||
self._display.warning('raw module does not support the environment keyword')
|
|
||||||
|
|
||||||
result = super(ActionModule, self).run(tmp, task_vars)
|
result = super(ActionModule, self).run(tmp, task_vars)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user