mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
try to make log detail show check vs actual changes
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user