'shell' is a magic module that executes the command module with shell=True

This commit is contained in:
Michael DeHaan 2012-03-14 20:40:06 -04:00
parent 73d20b81c6
commit 40fd778e2c
4 changed files with 30 additions and 5 deletions

View file

@ -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)