Not all package updates require a reboot.
You can make this more robust by installing yum-utils, run
/sbin/needs-restarting, and decide based on what that returns.
Example:
https://luktom.net/en/e1497-how-to-update-centos-rhel-using-ansible

On Debian based distros you’d check for the presence of
/var/run/reboot-required.

Dick

On Sun, 18 Aug 2019 at 10:45, Mike Eggleston <[email protected]> wrote:

> I am working on a playbook that uses yum. When yum does an update of all
> installed packages I want to do a conditional shutdown -r. What condition
> do I check from the yum task succeeding?
>
> Mike
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/47122EE6-9169-4E29-9AF9-B6C10697DEAA%40gmail.com
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwNRYG4EAK4f1mXEH6NtpA%3DNXP29ALkc6VaWNeeMtXn%3DNg%40mail.gmail.com.

Reply via email to