From ccab8ac2c01c018402a5b3659572bbc9c657c1e4 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 10 May 2012 01:14:30 -0400 Subject: [PATCH] Reinstate raw module --- lib/ansible/runner.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/ansible/runner.py b/lib/ansible/runner.py index 7ca9eb2d37a..bb9e5964fc8 100644 --- a/lib/ansible/runner.py +++ b/lib/ansible/runner.py @@ -331,6 +331,17 @@ class Runner(object): # ***************************************************** + def _execute_raw(self, conn, host, tmp): + ''' execute a non-module command for bootstrapping, or if there's no python on a device ''' + stdout, stderr = self._exec_command( conn, self.module_args, tmp, sudoable = True ) + data = dict(stdout=stdout) + if stderr: + data['stderr'] = stderr + return (host, True, data, '') + + # *************************************************** + + def _execute_normal_module(self, conn, host, tmp, module_name): ''' transfer & execute a module that is not 'copy' or 'template' ''' @@ -604,6 +615,8 @@ class Runner(object): result = self._execute_fetch(conn, host, tmp) elif self.module_name == 'template': result = self._execute_template(conn, host, tmp) + elif self.module_name == 'raw': + result = self._execute_raw(conn, host, tmp) else: if self.background == 0: result = self._execute_normal_module(conn, host, tmp, module_name)