diff options
author | Seth Vidal <skvidal@fedoraproject.org> | 2013-06-28 22:20:26 +0000 |
---|---|---|
committer | Seth Vidal <skvidal@fedoraproject.org> | 2013-06-28 22:20:26 +0000 |
commit | 67c1d4dfb68a1945e852134f79833e425cdeb401 (patch) | |
tree | 188bfe5987145678467c913c03de32f3a6bae3dd /callback_plugins | |
parent | 8c8e3675cb586b6a4e15673b309dcbedcb804c87 (diff) | |
download | ansible-67c1d4dfb68a1945e852134f79833e425cdeb401.tar.gz ansible-67c1d4dfb68a1945e852134f79833e425cdeb401.tar.xz ansible-67c1d4dfb68a1945e852134f79833e425cdeb401.zip |
make logdetail play better with ansible direct commands
Diffstat (limited to 'callback_plugins')
-rw-r--r-- | callback_plugins/logdetail.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/callback_plugins/logdetail.py b/callback_plugins/logdetail.py index 71640f055..d40ecf443 100644 --- a/callback_plugins/logdetail.py +++ b/callback_plugins/logdetail.py @@ -48,7 +48,7 @@ class LogMech(object): if self._pb_fn: return os.path.basename(self._pb_fn).replace('.yml', '').replace('.yaml', '') else: - return "Unknown-playbook" + return "ansible-cmd" @playbook_id.setter def playbook_id(self, value): @@ -74,7 +74,7 @@ class LogMech(object): # record out playbook.log # include path to playbook, checksums, user running playbook # any args we can get back from the invocation - fd = open(self.logpath_play + '/' + 'playbook.log', 'a') + fd = open(self.logpath_play + '/' + 'playbook.info', 'a') fd.write('%s\n' % content) fd.close() @@ -83,6 +83,8 @@ class LogMech(object): res['task_name'] = task.name res['task_module'] = task.module_name res['task_args'] = task.module_args + if self.playbook_id == 'ansible-cmd': + res['task_userid'] = os.getlogin() for k in ("delegate_to", "environment", "first_available_file", "local_action", "notified_by", "notify", "only_if", "register", "sudo", "sudo_user", "tags", @@ -105,10 +107,9 @@ class LogMech(object): invoc = data['invocation'] if not name and 'module_name' in invoc: name = invoc['module_name'] - - del(data['invocation']) + #don't add this since it can often contain complete passwords :( - #data.update(invoc) + del(data['invocation']) if task: name = task.name |