I'm currently using the ad-hoc command ansible ubuntu -a "ls -l /var/run/reboot-required"
to get a list of servers that require reboot. However, the end result is a list of all servers, and either the info about the indicated file or an error that the file does not exist.
I'm familiar enough with playbooks to create one that actually does the reboot, but I don't want that. I just want a nice (and relatively neat) list of servers that still require a reboot.
A more generic solution of getting a list of servers that meet some criteria (e.g. have a variable set) would also be quite helpful.