make kernel command line options configurable.
[noc.git] / ansible / roles / base / tasks / 07grub.yml
diff --git a/ansible/roles/base/tasks/07grub.yml b/ansible/roles/base/tasks/07grub.yml
new file mode 100644 (file)
index 0000000..dbc9b32
--- /dev/null
@@ -0,0 +1,7 @@
+---
+- name: set kernel command line options
+  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 %}"'
+  when: install is defined and install.kernel_cmdline is defined