Kernel arguments module

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

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.

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