make kernel command line options configurable.
authorChristian Pointner <equinox@realraum.at>
Thu, 10 Jan 2019 00:07:16 +0000 (01:07 +0100)
committerChristian Pointner <equinox@realraum.at>
Sat, 12 Jan 2019 22:48:22 +0000 (23:48 +0100)
fixes #51

ansible/host_vars/gnocchi0/main.yml
ansible/host_vars/gnocchi1/main.yml
ansible/roles/base/tasks/07grub.yml [new file with mode: 0644]
ansible/roles/base/tasks/main.yml
ansible/usb-install.yml

index d1fc949..5022f02 100644 (file)
@@ -11,3 +11,6 @@ network:
 install:
   disks:
     primary: /dev/disk/by-id/ata-KINGSTON_SMS200S360G_50026B726A0002A2
+  kernel_cmdline:
+    vga: "off"
+    console: "ttyS0,115200n8"
index 008bc57..8bbda9b 100644 (file)
@@ -11,3 +11,6 @@ network:
 install:
   disks:
     primary: /dev/disk/by-id/ata-KINGSTON_SMS200S360G_50026B726A00DFF4
+  kernel_cmdline:
+    vga: "off"
+    console: "ttyS0,115200n8"
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
index cff0d6a..124fa74 100644 (file)
@@ -6,3 +6,4 @@
   import_tasks: 04systemd.yml
 - import_tasks: 05tools.yml
 - import_tasks: 06net.yml
+- import_tasks: 07grub.yml
index 7469fe2..bf4ce64 100644 (file)
@@ -49,7 +49,7 @@
               LABEL linux
                KERNEL linux
                INITRD initrd.preseed.gz
-               APPEND install vga=off console=ttyS0,115200n8
+               APPEND install{% for opt,val in (install.kernel_cmdline | default({})).items() %} {{ opt }}={{ val }}{% endfor %}
 
         - name: Make the USB disk bootable
           pause: