ansible-install-server/roles/fai/tasks/fai-pxe-pxelinux.yml

289 lines
9.6 KiB
YAML

- name: install syslinux
package:
name: "{{ item }}"
state: present
with_items:
- pxelinux
- syslinux
- syslinux-efi
tags:
- pxe
- bios
- efi
- syslinux
- name: generate pxe directory structure
file:
name: "{{ item }}"
state: directory
with_items:
- /srv/tftp/fai/bios
- /srv/tftp/fai/efi32
- /srv/tftp/fai/efi64
tags:
- pxe
- bios
- efi
- syslinux
- name: copy pxelinux
copy:
src: /usr/lib/PXELINUX/pxelinux.0
dest: /srv/tftp/fai/bios/pxelinux.0
owner: root
group: root
remote_src: yes
tags:
- pxe
- syslinux
- name: copy pxe efi32
copy:
src: /usr/lib/SYSLINUX.EFI/efi32/syslinux.efi
dest: /srv/tftp/fai/efi32/syslinux.efi
owner: root
group: root
remote_src: yes
- name: copy pxe bios modules
copy:
src: "{{ item }}"
dest: /srv/tftp/fai/bios/
owner: root
group: root
remote_src: yes
with_items:
- /usr/lib/syslinux/modules/bios/dmitest.c32
- /usr/lib/syslinux/modules/bios/chain.c32
- /usr/lib/syslinux/modules/bios/libcom32.c32
- /usr/lib/syslinux/modules/bios/sysdump.c32
- /usr/lib/syslinux/modules/bios/sanboot.c32
- /usr/lib/syslinux/modules/bios/host.c32
- /usr/lib/syslinux/modules/bios/vesainfo.c32
- /usr/lib/syslinux/modules/bios/liblua.c32
- /usr/lib/syslinux/modules/bios/gfxboot.c32
- /usr/lib/syslinux/modules/bios/mboot.c32
- /usr/lib/syslinux/modules/bios/disk.c32
- /usr/lib/syslinux/modules/bios/meminfo.c32
- /usr/lib/syslinux/modules/bios/hdt.c32
- /usr/lib/syslinux/modules/bios/cpuid.c32
- /usr/lib/syslinux/modules/bios/cpu.c32
- /usr/lib/syslinux/modules/bios/libgpl.c32
- /usr/lib/syslinux/modules/bios/libutil.c32
- /usr/lib/syslinux/modules/bios/kontron_wdt.c32
- /usr/lib/syslinux/modules/bios/kbdmap.c32
- /usr/lib/syslinux/modules/bios/vesamenu.c32
- /usr/lib/syslinux/modules/bios/pci.c32
- /usr/lib/syslinux/modules/bios/ethersel.c32
- /usr/lib/syslinux/modules/bios/pmload.c32
- /usr/lib/syslinux/modules/bios/cptime.c32
- /usr/lib/syslinux/modules/bios/gpxecmd.c32
- /usr/lib/syslinux/modules/bios/whichsys.c32
- /usr/lib/syslinux/modules/bios/vesa.c32
- /usr/lib/syslinux/modules/bios/pxechn.c32
- /usr/lib/syslinux/modules/bios/lfs.c32
- /usr/lib/syslinux/modules/bios/ifplop.c32
- /usr/lib/syslinux/modules/bios/dmi.c32
- /usr/lib/syslinux/modules/bios/pcitest.c32
- /usr/lib/syslinux/modules/bios/cmenu.c32
- /usr/lib/syslinux/modules/bios/reboot.c32
- /usr/lib/syslinux/modules/bios/debug.c32
- /usr/lib/syslinux/modules/bios/ifmemdsk.c32
- /usr/lib/syslinux/modules/bios/zzjson.c32
- /usr/lib/syslinux/modules/bios/sdi.c32
- /usr/lib/syslinux/modules/bios/ldlinux.c32
- /usr/lib/syslinux/modules/bios/dhcp.c32
- /usr/lib/syslinux/modules/bios/menu.c32
- /usr/lib/syslinux/modules/bios/poweroff.c32
- /usr/lib/syslinux/modules/bios/elf.c32
- /usr/lib/syslinux/modules/bios/hexdump.c32
- /usr/lib/syslinux/modules/bios/libmenu.c32
- /usr/lib/syslinux/modules/bios/vpdtest.c32
- /usr/lib/syslinux/modules/bios/ifcpu.c32
- /usr/lib/syslinux/modules/bios/ls.c32
- /usr/lib/syslinux/modules/bios/cpuidtest.c32
- /usr/lib/syslinux/modules/bios/cmd.c32
- /usr/lib/syslinux/modules/bios/rosh.c32
- /usr/lib/syslinux/modules/bios/pwd.c32
- /usr/lib/syslinux/modules/bios/linux.c32
- /usr/lib/syslinux/modules/bios/config.c32
- /usr/lib/syslinux/modules/bios/ifcpu64.c32
- /usr/lib/syslinux/modules/bios/cat.c32
- /usr/lib/syslinux/modules/bios/lua.c32
- /usr/lib/syslinux/modules/bios/syslinux.c32
- /usr/lib/syslinux/modules/bios/prdhcp.c32
- /usr/lib/syslinux/modules/bios/dir.c32
tags:
- pxe
- efi
- name: copy pxe efi32 modules
copy:
src: "{{ item }}"
dest: /srv/tftp/fai/efi32/
owner: root
group: root
remote_src: yes
with_items:
- /usr/lib/syslinux/modules/efi32/dmitest.c32
- /usr/lib/syslinux/modules/efi32/chain.c32
- /usr/lib/syslinux/modules/efi32/libcom32.c32
- /usr/lib/syslinux/modules/efi32/sysdump.c32
- /usr/lib/syslinux/modules/efi32/host.c32
- /usr/lib/syslinux/modules/efi32/liblua.c32
- /usr/lib/syslinux/modules/efi32/gfxboot.c32
- /usr/lib/syslinux/modules/efi32/mboot.c32
- /usr/lib/syslinux/modules/efi32/meminfo.c32
- /usr/lib/syslinux/modules/efi32/hdt.c32
- /usr/lib/syslinux/modules/efi32/cpuid.c32
- /usr/lib/syslinux/modules/efi32/cpu.c32
- /usr/lib/syslinux/modules/efi32/libgpl.c32
- /usr/lib/syslinux/modules/efi32/ldlinux.e32
- /usr/lib/syslinux/modules/efi32/libutil.c32
- /usr/lib/syslinux/modules/efi32/vesamenu.c32
- /usr/lib/syslinux/modules/efi32/pci.c32
- /usr/lib/syslinux/modules/efi32/cptime.c32
- /usr/lib/syslinux/modules/efi32/whichsys.c32
- /usr/lib/syslinux/modules/efi32/vesa.c32
- /usr/lib/syslinux/modules/efi32/lfs.c32
- /usr/lib/syslinux/modules/efi32/dmi.c32
- /usr/lib/syslinux/modules/efi32/cmenu.c32
- /usr/lib/syslinux/modules/efi32/reboot.c32
- /usr/lib/syslinux/modules/efi32/debug.c32
- /usr/lib/syslinux/modules/efi32/zzjson.c32
- /usr/lib/syslinux/modules/efi32/dhcp.c32
- /usr/lib/syslinux/modules/efi32/menu.c32
- /usr/lib/syslinux/modules/efi32/hexdump.c32
- /usr/lib/syslinux/modules/efi32/libmenu.c32
- /usr/lib/syslinux/modules/efi32/vpdtest.c32
- /usr/lib/syslinux/modules/efi32/ifcpu.c32
- /usr/lib/syslinux/modules/efi32/ls.c32
- /usr/lib/syslinux/modules/efi32/cpuidtest.c32
- /usr/lib/syslinux/modules/efi32/cmd.c32
- /usr/lib/syslinux/modules/efi32/rosh.c32
- /usr/lib/syslinux/modules/efi32/pwd.c32
- /usr/lib/syslinux/modules/efi32/linux.c32
- /usr/lib/syslinux/modules/efi32/config.c32
- /usr/lib/syslinux/modules/efi32/ifcpu64.c32
- /usr/lib/syslinux/modules/efi32/cat.c32
- /usr/lib/syslinux/modules/efi32/lua.c32
- /usr/lib/syslinux/modules/efi32/syslinux.c32
- /usr/lib/syslinux/modules/efi32/dir.c32
tags:
- pxe
- efi
- name: copy pxe efi64 modules
copy:
src: "{{ item }}"
dest: /srv/tftp/fai/efi64/
owner: root
group: root
remote_src: yes
with_items:
- /usr/lib/syslinux/modules/efi64/dmitest.c32
- /usr/lib/syslinux/modules/efi64/chain.c32
- /usr/lib/syslinux/modules/efi64/libcom32.c32
- /usr/lib/syslinux/modules/efi64/sysdump.c32
- /usr/lib/syslinux/modules/efi64/host.c32
- /usr/lib/syslinux/modules/efi64/liblua.c32
- /usr/lib/syslinux/modules/efi64/gfxboot.c32
- /usr/lib/syslinux/modules/efi64/mboot.c32
- /usr/lib/syslinux/modules/efi64/meminfo.c32
- /usr/lib/syslinux/modules/efi64/hdt.c32
- /usr/lib/syslinux/modules/efi64/cpuid.c32
- /usr/lib/syslinux/modules/efi64/cpu.c32
- /usr/lib/syslinux/modules/efi64/libgpl.c32
- /usr/lib/syslinux/modules/efi64/ldlinux.e64
- /usr/lib/syslinux/modules/efi64/libutil.c32
- /usr/lib/syslinux/modules/efi64/vesamenu.c32
- /usr/lib/syslinux/modules/efi64/pci.c32
- /usr/lib/syslinux/modules/efi64/cptime.c32
- /usr/lib/syslinux/modules/efi64/whichsys.c32
- /usr/lib/syslinux/modules/efi64/vesa.c32
- /usr/lib/syslinux/modules/efi64/lfs.c32
- /usr/lib/syslinux/modules/efi64/dmi.c32
- /usr/lib/syslinux/modules/efi64/cmenu.c32
- /usr/lib/syslinux/modules/efi64/reboot.c32
- /usr/lib/syslinux/modules/efi64/debug.c32
- /usr/lib/syslinux/modules/efi64/zzjson.c32
- /usr/lib/syslinux/modules/efi64/dhcp.c32
- /usr/lib/syslinux/modules/efi64/menu.c32
- /usr/lib/syslinux/modules/efi64/hexdump.c32
- /usr/lib/syslinux/modules/efi64/libmenu.c32
- /usr/lib/syslinux/modules/efi64/vpdtest.c32
- /usr/lib/syslinux/modules/efi64/ifcpu.c32
- /usr/lib/syslinux/modules/efi64/ls.c32
- /usr/lib/syslinux/modules/efi64/cpuidtest.c32
- /usr/lib/syslinux/modules/efi64/cmd.c32
- /usr/lib/syslinux/modules/efi64/rosh.c32
- /usr/lib/syslinux/modules/efi64/pwd.c32
- /usr/lib/syslinux/modules/efi64/linux.c32
- /usr/lib/syslinux/modules/efi64/config.c32
- /usr/lib/syslinux/modules/efi64/ifcpu64.c32
- /usr/lib/syslinux/modules/efi64/cat.c32
- /usr/lib/syslinux/modules/efi64/lua.c32
- /usr/lib/syslinux/modules/efi64/syslinux.c32
- /usr/lib/syslinux/modules/efi64/dir.c32
tags:
- pxe
- efi
- name: write pxe default config for bios/efi32/efi64
copy:
content: |
DEFAULT bios/menu.c32
PROMPT 0
MENU TITLE FAI Setup
MENU AUTOBOOT Starting FAI install
TIMEOUT 300
INCLUDE ::fai.cfg
INCLUDE ::dban.cfg
dest: /srv/tftp/fai/bios/default
mode: 0644
owner: root
group: root
with_items:
- /srv/tftp/fai/bios/default
- /srv/tftp/fai/efi32/default
- /srv/tftp/fai/efi64/default
tags:
- pxe
- tftp
- fai
- name: write pxe fai boot config
copy:
content: |
LABEL fai
MENU DEFAULT
MENU LABEL FAI Installer
KERNEL vmlinuz-{{linux_version}}-amd64
APPEND initrd=initrd.img-{{linux_version}}-amd64 ip=dhcp root=live:http://{{server_ip}}/tftp/fai/squash.img FAI_FLAGS=verbose,sshd,createv{% if fai_menu %},menu{% endif %} FAI_CONFIG_SRC=http://{{server_ip}}/fai/config.tar FAI_ACTION=install
dest: /srv/tftp/fai/fai.cfg
mode: 0644
owner: root
group: root
tags:
- pxe
- tftp
- fai
- name: write pxe fai boot config
copy:
content: |
LABEL dban
MENU LABEL Darik's Boot And Nuke Tool
KERNEL dban.bzi
APPEND nuke="dwipe" silent vga=785
dest: /srv/tftp/fai/dban.cfg
mode: 0644
owner: root
group: root
tags:
- pxe
- tftp
- fai