variables for reboot

Howdy all

I have a playbook that I want to run hourly to check for new hosts and I have a script that returns a variable of new and this host gets the yum update and yum reboot and then come around again this host variable is now old…

My question is how can I get this playbook to run the yum update and reboot when the variable returns as new?

If the variable is old then it skips this

not sure about old variables but, I used yum.changed after a task runs yum update all.