mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
'shell' is a magic module that executes the command module with shell=True
This commit is contained in:
@@ -308,6 +308,12 @@ class Runner(object):
|
||||
because those require extra work.
|
||||
'''
|
||||
|
||||
# hack to make the 'shell' module keyword really be executed
|
||||
# by the command module
|
||||
if self.module_name == 'shell':
|
||||
self.module_name = 'command'
|
||||
self.module_args.append("#USE_SHELL")
|
||||
|
||||
module = self._transfer_module(conn, tmp, self.module_name)
|
||||
result = self._execute_module(conn, tmp, module, self.module_args)
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ def host_report_msg(hostname, module_name, result, oneline):
|
||||
''' summarize the JSON results for a particular host '''
|
||||
buf = ''
|
||||
failed = is_failed(result)
|
||||
if module_name == 'command':
|
||||
if module_name in [ 'command', 'shell' ]:
|
||||
if not failed:
|
||||
buf = command_success_msg(hostname, result, oneline)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user