Hey all-
I need to find the first host in the inventory running a particular process. I can query the hosts to look for the process using a shell pipeline and register the output in a variable (call it ps_output). But I’m stuck on how to iterate over the hosts, examining the value of ps_output, and stopping when I have found the first one. I don’t see a built in filter for this (maybe I need to write one?), I’ve struck out with templating, and I currently have it working with a complicated mess of storing the hostvars in a file and processing it with an external python script, but I have to believe there’s an easier way. Any suggestions?
Rob