- name: deploy syslinux hosts: "{{target}}" gather_facts: no become: "{{become_var}}" tasks: - name: boot blocks and boot code shell: executable: /bin/bash cmd: | set -e boot_disk={{boot_disk}} boot_partition={{boot_partition}} 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 != '' - name: syslinux boots xen template: src: syslinux.cfg dest: /boot/syslinux/syslinux.cfg - name: console goes hvc0 lineinfile: path: /etc/inittab regexp: '^s1:' line: s1:12345:respawn:/sbin/agetty --noclear --local-line hvc0 115200 linux