I have a playback 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
- name: Reboot the system
reboot:
when: my_yum_variable != 'new'