Merge pull request #53 from realraum/install/serial
authorChristian Pointner <equinox@spreadspace.org>
Sat, 12 Jan 2019 23:25:57 +0000 (00:25 +0100)
committerGitHub <noreply@github.com>
Sat, 12 Jan 2019 23:25:57 +0000 (00:25 +0100)
make kernel command line options configurable

ansible/host_vars/gnocchi0/main.yml
ansible/host_vars/gnocchi1/main.yml
ansible/roles/base/handlers/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..7d46862 100644 (file)
@@ -11,3 +11,5 @@ network:
 install:
   disks:
     primary: /dev/disk/by-id/ata-KINGSTON_SMS200S360G_50026B726A0002A2
+  kernel_cmdline:
+    - console=ttyS0,115200n8
index 008bc57..6ecab28 100644 (file)
@@ -11,3 +11,5 @@ network:
 install:
   disks:
     primary: /dev/disk/by-id/ata-KINGSTON_SMS200S360G_50026B726A00DFF4
+  kernel_cmdline:
+    - console=ttyS0,115200n8
index a86fcde..920db82 100644 (file)
@@ -8,3 +8,6 @@
   service:
     name: openntpd
     state: restarted
+
+- name: update grub
+  command: update-grub
diff --git a/ansible/roles/base/tasks/07grub.yml b/ansible/roles/base/tasks/07grub.yml
new file mode 100644 (file)
index 0000000..4aa2122
--- /dev/null
@@ -0,0 +1,8 @@
+---
+- name: set kernel command line options
+  lineinfile:
+    path: /etc/default/grub
+    regexp: '^#?GRUB_CMDLINE_LINUX='
+    line: 'GRUB_CMDLINE_LINUX="{{ install.kernel_cmdline | join(" ") }}"'
+  when: install is defined and install.kernel_cmdline is defined
+  notify: update grub
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..9662520 100644 (file)
@@ -49,7 +49,7 @@
               LABEL linux
                KERNEL linux
                INITRD initrd.preseed.gz
-               APPEND install vga=off console=ttyS0,115200n8
+               APPEND install {{ (install.kernel_cmdline | default([])) | join(' ') }}
 
         - name: Make the USB disk bootable
           pause: