- name: setup syslinux gather_facts: no hosts: "{{target}}" become: "{{become_var}}" tasks: - name: boot blocks and boot code ansible.builtin.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 ansible.builtin.copy: content: | # CONFIGURED BY ANSIBLE serial 0 115200 console 1 nohalt 1 default xen prompt 1 timeout 30 label xen kernel mboot.c32 append /xen.gz dom0_mem={{dom0_mem}} noreboot=true loglvl=info guest_loglvl=info smt=1 ept=exec-sp com1=115200,8n1 console=com1,vga --- /vmlinuz root={{boot_partition}} ro console=hvc0 earlyprintk=xen mitigations=off label linux linux /vmlinuz append root={{boot_partition}} ro console=tty1 console=ttyS0,115200n8 mitigations=off dest: /boot/syslinux/syslinux.cfg - name: console goes hvc0 ansible.builtin.lineinfile: path: /etc/inittab regexp: '^s1:' line: s1:12345:respawn:/sbin/agetty --noclear --local-line hvc0 115200 linux