# Set GRUB\_DEFAULT by kernel version

**URL:** <https://forum.ansible.com/t/set-grub-default-by-kernel-version/33360>\
**Category:** Ansible Developer\
**Created:** [July 9, 2020, 1:00pm UTC](https://forum.ansible.com/t/set-grub-default-by-kernel-version/33360 "2020-07-09T13:00:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jabb\_degen](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jabb\_degen](https://forum.ansible.com/u/jabb_degen)\
**Post date:** [July 9, 2020, 1:00pm UTC](https://forum.ansible.com/t/set-grub-default-by-kernel-version/33360/1 "2020-07-09T13:00:59Z")

</div>

Hey guys,  
I want set the GRUB\_DEFAULT Variable accordingly to a specified kernel version. I’m not quite sure how to do it in an ansible clean way.

Pseudo code which explains the desired task

> **(attachments)**
>
> [func](https://forum.ansible.com/uploads/short-url/xwds98XVNt4mHkyyslwBpPzdtoc) (902 Bytes)
