Ending summary of a playbook

Hey all,

Is there any way to write out where I would get a summary of a playbook, other than what is already given with the passes, fails, changed, etc. Let’s say I write a playbook listing all servers/workstations that need to be rebooted after a kernel patch.

Is there a way to do this? I’ve got a playbook already in place that where it says:

  • debug:
    msg: “{{ inventory_hostname}} {{ reboot_required.stdout }}”
    when: reboot_required.stdout == “reboot”
    tags: reboot

That goes as the playbook runs. I’d like to get a listing of all that match this at the end. Any ideas?

Thanks!

Chris

you might be able to do this via set_stats
https://docs.ansible.com/ansible/latest/modules/set_stats_module.html?
and the 'show custom stats' setting
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#show-custom-stats