lineinfile:
path: /etc/default/grub
regexp: '^#?GRUB_CMDLINE_LINUX='
- line: 'GRUB_CMDLINE_LINUX="{% for opt,val in (install.kernel_cmdline | default({})).items() %}{{ opt }}={{ val }}{% if not loop.last %} {% endif %}{% endfor %}"'
+ line: 'GRUB_CMDLINE_LINUX="{{ install.kernel_cmdline | join(" ") }}"'
when: install is defined and install.kernel_cmdline is defined
notify: update grub