Hi,
we have a callback plugin (Ansible 1.8.4) which gathers information during the playbook run and stores them in a class-local variable.
On playbook end this should be displayed in the log (e.g. warnings and errors found)
Here is the relevant code:
class CallbackModule(object):
…
saved_logs = {}
def runner_on_failed(self, host, res, ignore_errors=False):
… put something in saved_logs
def runner_on_ok(self, host, res):
… put something in saved_logs
def runner_on_error(self, host, msg):
… put something in saved_logs
def runner_on_skipped(self, host, item=None):
… put something in saved_logs
def playbook_on_stats(self, stats):
… display contents of saved_logs
Now it seems that the Callback gets one instance per fork as we only see in stats the content which was added by tasks running on the controller. Logs generated e.g. in modules running on the nodes are only available in stats if “fork” is set to 1
Is this behaviour intentional?
How should we fix/synchronize this?
Regards Michael