Merge pull request #5843 from jimi-c/issue_4088

Adding no_log: capability for tasks
reviewable/pr18780/r1
James Cammarata 11 years ago
commit 8a9f0f7478

@ -184,7 +184,7 @@ class CommandModule(AnsibleModule):
args = args.replace("#USE_SHELL", "")
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):
v = m.group(4).replace("\\", "")
if m.group(2) == "creates":
@ -203,6 +203,8 @@ class CommandModule(AnsibleModule):
if not (os.path.exists(v)):
self.fail_json(rc=258, msg="cannot use executable '%s': file does not exist" % v)
params['executable'] = v
elif m.group(2) == "NO_LOG":
params['NO_LOG'] = self.boolean(v)
args = r.sub("", args)
params['args'] = args
return (params, params['args'])

Loading…
Cancel
Save