Playbook hanging on kernel update

I’ve written the following playbook that seems to work perfectly, except when I comment out the kernel update task. Hopefully nothing that I’ve just missed from the docs.

`

It seems that you should register ‘kernelup’ only for the first task, not twice.

Sorry, that was left in after I tested commenting out the Kernel update task. That isn’t in the script that is failing.

Maybe I get something wrong, but why do you register kernelup for the “other updates”?

No, kernelup is only registered for the kernel update (the first one) - the second kernelup registration was only used to test that it registers and test functionality but is not meant to be there.

Could you try pasting the ansible playbook that is failing (if the one
you pasted isn't it).

Running the following playbook with: ansible-playbook update_system.yml --limit=production -K

`

Have just done a watch on the process list on the server that this is running against and I can now see that it’s NOT hanging at all. In fact, what it’s doing is running repoquery against all possible kernel packages. Not sure if it’s normal for this to take so long but at least I have something to work on.

root 27883 27429 99 13:02 pts/0 00:00:01 | _ /usr/bin/python -tt /usr/bin/repoquery --show-duplicates --plugins --quiet -q --pkgnarrow=updates --qf %{name}-%{version}-%{release}.%{arch} kernel-debug-devel-2.6.18-371.el5.x86_64

It needs to run that to know if certain things need to change or not.

You may wish to consider just shelling to yum update *.

It has been discussed in the past if we want to just run the yum command and report if changes were made, though that has historically been against our philosophy of not running commands that can create changes unnecessarily.

That works but the problem is that if a kernel patch is installed I want to restart. Do you know of any play books around that might fulfil this?

I’m not sure.

Perhaps you could register a timestamp of the kernel or the last changed time of the kernel page, run the update, and then use a when statement to see if it changed?

This could be a no-op statement that notified a reboot as the last action in your playbook.