# Playbook hanging on kernel update

**URL:** <https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473>\
**Category:** Ansible Project\
**Created:** [June 16, 2014, 2:52pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473 "2014-06-16T14:52:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ammullan](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ammullan](https://forum.ansible.com/u/ammullan)\
**Post date:** [June 16, 2014, 2:52pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/1 "2014-06-16T14:52:58Z")

</div>

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.

`

---

<div class="post-metadata">

**Author:** ![Ernest0x](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Ernest0x](https://forum.ansible.com/u/Ernest0x)\
**Post date:** [June 16, 2014, 3:49pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/2 "2014-06-16T15:49:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ammullan](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ammullan](https://forum.ansible.com/u/ammullan)\
**Post date:** [June 16, 2014, 3:52pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/3 "2014-06-16T15:52:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Christian\_Rusa](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@Christian\_Rusa](https://forum.ansible.com/u/Christian_Rusa)\
**Post date:** [June 16, 2014, 3:56pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/4 "2014-06-16T15:56:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ammullan](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ammullan](https://forum.ansible.com/u/ammullan)\
**Post date:** [June 16, 2014, 6:16pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/5 "2014-06-16T18:16:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [June 16, 2014, 6:43pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/6 "2014-06-16T18:43:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ammullan](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ammullan](https://forum.ansible.com/u/ammullan)\
**Post date:** [June 16, 2014, 6:52pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/7 "2014-06-16T18:52:48Z")

</div>

Running the following playbook with: **ansible-playbook update\_system.yml --limit=production -K**

`

---

<div class="post-metadata">

**Author:** ![ammullan](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ammullan](https://forum.ansible.com/u/ammullan)\
**Post date:** [June 18, 2014, 12:04pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/8 "2014-06-18T12:04:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 18, 2014, 3:52pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/9 "2014-06-18T15:52:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ammullan](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ammullan](https://forum.ansible.com/u/ammullan)\
**Post date:** [June 18, 2014, 5:59pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/10 "2014-06-18T17:59:21Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 19, 2014, 9:18pm UTC](https://forum.ansible.com/t/playbook-hanging-on-kernel-update/15473/11 "2014-06-19T21:18:05Z")

</div>

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.
