ansible: Make install.kernel_cmdline a list
authornicoo <nicoo@realraum.at>
Sat, 12 Jan 2019 23:02:33 +0000 (00:02 +0100)
committernicoo <nicoo@realraum.at>
Sat, 12 Jan 2019 23:06:48 +0000 (00:06 +0100)
Not all kernel command-line parameters look like key=value.

ansible/host_vars/gnocchi0/main.yml
ansible/host_vars/gnocchi1/main.yml
ansible/roles/base/tasks/07grub.yml
ansible/usb-install.yml

index 84b2417..7d46862 100644 (file)
@@ -12,4 +12,4 @@ install:
   disks:
     primary: /dev/disk/by-id/ata-KINGSTON_SMS200S360G_50026B726A0002A2
   kernel_cmdline:
-    console: "ttyS0,115200n8"
+    - console=ttyS0,115200n8
index 12fddef..6ecab28 100644 (file)
@@ -12,4 +12,4 @@ install:
   disks:
     primary: /dev/disk/by-id/ata-KINGSTON_SMS200S360G_50026B726A00DFF4
   kernel_cmdline:
-    console: "ttyS0,115200n8"
+    - console=ttyS0,115200n8
index a52f542..2a2dda7 100644 (file)
@@ -3,6 +3,6 @@
   lineinfile:
     path: /etc/default/grub
     regexp: '^#?GRUB_CMDLINE_LINUX='
-    line: 'GRUB_CMDLINE_LINUX="{{ map(lambda opt, val: opt + "=" + val, (install.kernel_cmdline or {}).items()).join(" ") }}"'
+    line: 'GRUB_CMDLINE_LINUX="{{ (install.kernel_cmdline or []).join(" ") }}"'
   when: install is defined and install.kernel_cmdline is defined
   notify: update grub
index d5730d9..985e560 100644 (file)
@@ -49,7 +49,7 @@
               LABEL linux
                KERNEL linux
                INITRD initrd.preseed.gz
-               APPEND install {{ map(lambda opt, val: opt + ' ' + val, (install.kernel_cmdline or {}).items()).join(' ') }}
+               APPEND install {{ (install.kernel_cmdline or []).join(' ') }}
 
         - name: Make the USB disk bootable
           pause: