# I have a ansible task "yum\_update\_kernel" but I hosts I can not update the kernel on.

**URL:** <https://forum.ansible.com/t/i-have-a-ansible-task-yum-update-kernel-but-i-hosts-i-can-not-update-the-kernel-on/23822>\
**Category:** Ansible Project\
**Created:** [February 26, 2017, 2:49pm UTC](https://forum.ansible.com/t/i-have-a-ansible-task-yum-update-kernel-but-i-hosts-i-can-not-update-the-kernel-on/23822 "2017-02-26T14:49:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Brendlinger](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@David\_Brendlinger](https://forum.ansible.com/u/David_Brendlinger)\
**Post date:** [February 26, 2017, 2:49pm UTC](https://forum.ansible.com/t/i-have-a-ansible-task-yum-update-kernel-but-i-hosts-i-can-not-update-the-kernel-on/23822/1 "2017-02-26T14:49:21Z")

</div>

Hello

I have a ansible role “yum\_update\_kernel” but I hosts I can not update the kernel on.

can I hardcode “never run this role” if hostname is “name1” “name2” “name3”

timfox123

---

<div class="post-metadata">

**Author:** ![Nehal\_J\_Wani](https://avatars.discourse-cdn.com/v4/letter/n/a9a28c/32.png) [@Nehal\_J\_Wani](https://forum.ansible.com/u/Nehal_J_Wani)\
**Post date:** [February 28, 2017, 4:58am UTC](https://forum.ansible.com/t/i-have-a-ansible-task-yum-update-kernel-but-i-hosts-i-can-not-update-the-kernel-on/23822/2 "2017-02-28T04:58:10Z")

</div>

Probably, you are looking for applying a condition to a role: [http://docs.ansible.com/ansible/playbooks\_conditionals.html#applying-when-to-roles-and-includes](http://docs.ansible.com/ansible/playbooks_conditionals.html#applying-when-to-roles-and-includes)
