Adding no_log: capability for tasks

Fixes #4088
This commit is contained in:
James Cammarata 2014-01-31 16:09:10 -06:00
parent 0dff07b53e
commit 6ed8c594f4

View file

@ -184,7 +184,7 @@ class CommandModule(AnsibleModule):
args = args.replace("#USE_SHELL", "") args = args.replace("#USE_SHELL", "")
params['shell'] = True params['shell'] = True
r = re.compile(r'(^|\s)(creates|removes|chdir|executable)=(?P<quote>[\'"])?(.*?)(?(quote)(?<!\\)(?P=quote))((?<!\\)(?=\s)|$)') r = re.compile(r'(^|\s)(creates|removes|chdir|executable|NO_LOG)=(?P<quote>[\'"])?(.*?)(?(quote)(?<!\\)(?P=quote))((?<!\\)(?=\s)|$)')
for m in r.finditer(args): for m in r.finditer(args):
v = m.group(4).replace("\\", "") v = m.group(4).replace("\\", "")
if m.group(2) == "creates": if m.group(2) == "creates":
@ -203,6 +203,8 @@ class CommandModule(AnsibleModule):
if not (os.path.exists(v)): if not (os.path.exists(v)):
self.fail_json(rc=258, msg="cannot use executable '%s': file does not exist" % v) self.fail_json(rc=258, msg="cannot use executable '%s': file does not exist" % v)
params['executable'] = v params['executable'] = v
elif m.group(2) == "NO_LOG":
params['NO_LOG'] = self.boolean(v)
args = r.sub("", args) args = r.sub("", args)
params['args'] = args params['args'] = args
return (params, params['args']) return (params, params['args'])