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="{{ map(lambda opt, val: opt + "=" + val, (install.kernel_cmdline or {}).items()).join(" ") }}"'
when: install is defined and install.kernel_cmdline is defined
notify: update grub
LABEL linux
KERNEL linux
INITRD initrd.preseed.gz
- APPEND install{% for opt,val in (install.kernel_cmdline | default({})).items() %} {{ opt }}={{ val }}{% endfor %}
+ APPEND install {{ map(lambda opt, val: opt + ' ' + val, (install.kernel_cmdline or {}).items()).join(' ') }}
- name: Make the USB disk bootable
pause: