# Kernel arguments module

**URL:** <https://forum.ansible.com/t/kernel-arguments-module/13991>\
**Category:** Ansible Project\
**Created:** [November 24, 2013, 10:45pm UTC](https://forum.ansible.com/t/kernel-arguments-module/13991 "2013-11-24T22:45:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gonzalo\_Servat](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Gonzalo\_Servat](https://forum.ansible.com/u/Gonzalo_Servat)\
**Post date:** [November 24, 2013, 10:45pm UTC](https://forum.ansible.com/t/kernel-arguments-module/13991/1 "2013-11-24T22:45:35Z")

</div>

Hi All,

I’m thinking of writing a kernel\_arg module to help with modifying kernel arguments in /boot/grub/menu.lst, but before I do that just wanted to make sure no such module exists? (I had a look at the Ansible Modules list… not there)

Ideally I’d like to be able to do something like:

kernel\_arg: name={{ item.0 }} value={{ item.1 }} state=present  
with\_items:

- [‘splash’, ‘silent’] # splash=silent

- [‘showopts’, None] # this should become just ‘showopts’

- [‘biosdevname’, 1] # biosdevname=1

- [‘crashkernel’, ‘’] # crashkernel=

How are others modifying kernel arguments?

GS

---

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [November 24, 2013, 11:16pm UTC](https://forum.ansible.com/t/kernel-arguments-module/13991/2 "2013-11-24T23:16:31Z")

</div>

I need the same module, haven't got around it yet.

It is important however to understand that options can be repeated and that order is important to retain. So it has some similarity to lineinfile.

---

<div class="post-metadata">

**Author:** ![Gonzalo\_Servat](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Gonzalo\_Servat](https://forum.ansible.com/u/Gonzalo_Servat)\
**Post date:** [November 24, 2013, 11:50pm UTC](https://forum.ansible.com/t/kernel-arguments-module/13991/3 "2013-11-24T23:50:16Z")

</div>

True, forgot about that. You can have 'console=tty' and  
'console=ttyS0,9600'. I guess ideally it should support:

kernel\_arg: name=console value='ttyS0,9600' after='console=tty'  
state=present

Would this be enough for now?

The one gotcha I see is if you are trying to modify kernel arguments from  
different roles as it depends on what order the roles are called in and  
that may alter the order in which arguments are applied.

GS
