bin/ansible callbacks; equivalent of on_stats?

I’d like to use my callbacks in bin/ansible as well as bin/ansible-playbook

I have
bin_ansible_callbacks = True
and events are firing, but when I run bin/ansible on_stats doesn’t seem to fire.

Is there another callback method I can override so I can perform some cleanup in my callback plugin?

Alternatively can I detect whether I’m running bin/ansible or bin/ansible-playbook in some way - I guess I could trap
runner_on_ok, runner_on_skipped and runner_on_failed as there will probably only be 1 of these events in a given bin/ansible run.

Many thanks,

Jon

Jon

And to answer my own question…

Turns out in my case, it looks like I can use python’s own object destructor

def del(self):

cleanup here

as long as the cleanup happens before the program ends its not critical.