try to make log detail show check vs actual changes

This commit is contained in:
Seth Vidal 2013-07-05 18:24:39 -04:00
parent a8f0718281
commit 8455e65fbf

View file

@ -130,7 +130,9 @@ class LogMech(object):
if category == 'OK' and data.get('changed', False):
category = 'CHANGED'
if self.play_info.check:
category = 'CHECK:' + category
fd = open(self.logpath_play + '/' + host + '.log', 'a')
now = time.strftime(TIME_FORMAT, time.localtime())
@ -253,6 +255,7 @@ class CallbackModule(object):
pb_info['extra_vars'] = play.playbook.extra_vars
pb_info['inventory'] = play.playbook.inventory.host_list
pb_info['playbook_checksum'] = utils.md5(path)
pb_info['check'] = play.playbook.check
logmech.play_log(json.dumps(pb_info, indent=4))
self._play_count += 1
@ -262,6 +265,7 @@ class CallbackModule(object):
info['hosts'] = play.hosts
info['transport'] = play.transport
info['number'] = self._play_count
info['check'] = play.playbook.check
logmech.play_info = info
logmech.play_log(json.dumps(info, indent=4))