- name: boot blocks and boot code shell: executable: /bin/bash cmd: | set -e ls -lhF /usr/share/syslinux/mbr.bin ls -lhF /usr/share/syslinux/libcom32.c32 ls -lhF /usr/share/syslinux/mboot.c32 extlinux -v echo -n checking for syslinux mbr boot blocks ... if [[ `dd if={{boot_disk}} bs=440 count=1 | strings | head -1` = RPf1 ]]; then echo already else echo overriding dd if=/usr/share/syslinux/mbr.bin of={{boot_disk}} fi mkdir -p /boot/syslinux/ [[ ! -d /boot/syslinux/ldlinux.c32 ]] && extlinux --device {{boot_partition}} --install /boot/syslinux [[ ! -f /boot/syslinux/libcom32.c32 ]] && cp -nv /usr/share/syslinux/libcom32.c32 /boot/syslinux/ [[ ! -f /boot/syslinux/mboot.c32 ]] && cp -nv /usr/share/syslinux/mboot.c32 /boot/syslinux/ creates: /boot/syslinux/ldlinux.c32 register: blocks - debug: var=blocks.stdout when: blocks.stdout != '' - debug: var=blocks.stderr when: blocks.stderr != '' # rc.local takes care of that at boot-time, but it won't hurt to get it right already - name: serial console template: src: serial.tab dest: /etc/inittab.d/serial.tab