debops.ipxe default variables

APT packages

ipxe__base_packages

List of the default APT packages to install for iPXE support.

ipxe__base_packages: [ 'ipxe', 'pax', 'cpio', 'syslinux-common',
                       'openssl', 'ca-certificates' ]
ipxe__packages

List of additional APT packages to install with iPXE.

ipxe__packages: []

TFTP environment

ipxe__tftp_root

Absolute path to the TFTP root directory.

ipxe__tftp_root: '{{ ansible_local.tftpd.directory|d(ansible_local.dnsmasq.boot_tftp_root|d("/srv/tftp")) }}'
ipxe__bootloaders

List of files on the remote host which will be copied to the TFTP root directory. These files are boot loaders called during the PXE boot via the DHCP options. Bootloaders are provided by the installed APT packages.

ipxe__bootloaders:
  - '/usr/lib/syslinux/memdisk'
  - '/usr/lib/ipxe/undionly.kpxe'
  - '/boot/ipxe.efi'

Debian Installer network boot

ipxe__debian_netboot_enabled

Enable or disable support for configuring a set of Debian Installer instances which can be used to install Debian releases over the network.

ipxe__debian_netboot_enabled: True
ipxe__debian_netboot_firmware

Enable or disable inclusion of the non-free firmware packages in the Debian Installer images. The non-free firmware might be required to use certain hardware (network cards, storage drivers, etc.).

ipxe__debian_netboot_firmware: '{{ ansible_local.apt.nonfree|d()|bool }}'
ipxe__debian_netboot_src

The base directory where the Debian netboot and firmware tarballs will be downloaded. The final directory depends on a given OS release and hardware architecture.

ipxe__debian_netboot_src: '{{ (ansible_local.fhs.src | d("/usr/local/src"))
                              + "/ipxe/debian/netboot" }}'
ipxe__debian_netboot_pxe_root

The base directory where Debian Installer tarballs will be unpacked. The final directory depends on a given OS release and hardware architecture.

ipxe__debian_netboot_pxe_root: '{{ ipxe__tftp_root + "/pxe/linux/debian" }}'
ipxe__debian_netboot_mirror

The base URL from which the Debian netboot tarballs will be downloaded. This should be a fully-fledged Debian mirror.

ipxe__debian_netboot_mirror: 'https://deb.debian.org/debian'
ipxe__debian_netboot_firmware_mirror

The base URL from which the Debian firmware tarballs will be downloaded.

ipxe__debian_netboot_firmware_mirror: 'https://cdimage.debian.org/cdimage/unofficial/non-free/firmware'
ipxe__debian_netboot_releases

Specify which Debian releases will be prepared for iPXE boot on a given host. The releases need to be defined in the OS release map below.

ipxe__debian_netboot_releases: [ 'jessie', 'stretch', 'buster' ]
ipxe__debian_netboot_architectures

Specify which Debian architectures will be prepared for iPXE boot on a given host. The architectures need to be defined in the OS release map below.

ipxe__debian_netboot_architectures: [ 'amd64', 'i386', 'arm64' ]

Debian Installer release maps

These lists define the Debian Installer releases that will be downloaded and prepared for use via iPXE boot. See ipxe__debian_netboot_release_map for more details.

ipxe__debian_netboot_default_release_map

The list of the default Debian Installer releases defined by the role.

ipxe__debian_netboot_default_release_map:

  - name: 'jessie-amd64'
    release: 'jessie'
    architecture: 'amd64'
    netboot_version: '20150422+deb8u5'
    netboot_checksum: 'sha256:f52fa82a53cc2a2912765396e2adfd715234c9e1137ac5112ebc10f50a69b525'  # netboot.tar.gz
    firmware_version: '20190211'
    firmware_checksum: 'sha256:085f8a68b196955c984515849314fdccf6d5ba5b6b8bbef157dcb50f2cb8c0cf'  # firmware.cpio.gz

  - name: 'jessie-amd64-gtk'
    release: 'jessie'
    architecture: 'amd64'
    netboot_subdir: '/gtk'
    netboot_version: '20150422+deb8u5'
    netboot_checksum: 'sha256:60214b3a902da49cb2f8379df1502057e6d13522526a98db489f5830c60f8014'  # netboot.tar.gz
    firmware_version: '20190211'
    firmware_checksum: 'sha256:085f8a68b196955c984515849314fdccf6d5ba5b6b8bbef157dcb50f2cb8c0cf'  # firmware.cpio.gz

  - name: 'stretch-amd64'
    release: 'stretch'
    architecture: 'amd64'
    netboot_version: '20170615+deb9u9'
    netboot_checksum: 'sha256:f25408235e7a13fb05804512ad415ec78ce8e5d18f31cd2bdfe5b75c2c373047'  # netboot.tar.gz
    firmware_version: '20200718'
    firmware_checksum: 'sha256:77fd3c1f66b530c868ac2a1d2b27cd2fc2e4a592bff48726c8e2e475d1a7eb16'  # firmware.cpio.gz

  - name: 'stretch-amd64-gtk'
    release: 'stretch'
    architecture: 'amd64'
    netboot_subdir: '/gtk'
    netboot_version: '20170615+deb9u9'
    netboot_checksum: 'sha256:3ba002234396044fec57faecd60acd77968850f92c67ef209731231eaf3b38e4'  # gtk/netboot.tar.gz
    firmware_version: '20200718'
    firmware_checksum: 'sha256:77fd3c1f66b530c868ac2a1d2b27cd2fc2e4a592bff48726c8e2e475d1a7eb16'  # firmware.cpio.gz

  - name: 'buster-amd64'
    release: 'buster'
    architecture: 'amd64'
    netboot_version: '20190702+deb10u9'
    netboot_checksum: 'sha256:79c398880954ebe6bda58b3eaa117336532527d9f2f394bf0b98f603cbb5d13f'  # netboot.tar.gz
    firmware_version: '20210327'
    firmware_checksum: 'sha256:f69ffd2202e5aee01b8f500a46daddfb9f787788d4acac5069e6a331d375e721'  # firmware.cpio.gz

  - name: 'buster-amd64-gtk'
    release: 'buster'
    architecture: 'amd64'
    netboot_subdir: '/gtk'
    netboot_version: '20190702+deb10u9'
    netboot_checksum: 'sha256:e2619a47fc20caaa11c192573ec7e1f062459dca9d252c775b9549470b5b41a7'  # netboot.tar.gz
    firmware_version: '20210327'
    firmware_checksum: 'sha256:f69ffd2202e5aee01b8f500a46daddfb9f787788d4acac5069e6a331d375e721'  # firmware.cpio.gz
ipxe__debian_netboot_release_map

The list of Debian Installer releases defined by the administrator. This variable can be used to modify the default release list if necessary.

ipxe__debian_netboot_release_map: []
ipxe__debian_netboot_combined_release_map

The variable which combines the lists of the Debian Installer releases and is used in the role tasks and templates.

ipxe__debian_netboot_combined_release_map: '{{ ipxe__debian_netboot_default_release_map
                                               + ipxe__debian_netboot_release_map }}'

iPXE scripts

These lists define the iPXE menu scripts stored in the FTFP root directory. See ipxe__scripts for more details.

ipxe__default_scripts

The list of the default iPXE scripts defined by the role.

ipxe__default_scripts:

  - name: 'variables.ipxe'
    comment: 'iPXE global variables'
    options:

      - name: 'main_menu_title'
        comment: 'The main menu title'
        value: '{{ ansible_local.machine.organization|d("DebOps") + " Boot Menu" }}'

      - name: 'debian_installer_mirror'
        comment: 'Debian mirror used during automated installation'
        value: 'deb.debian.org'

      - name: 'debian_installer_preseed'
        comment: 'Default preseed subdomain to use'
        value: 'debian.seed'

      - name: 'debian_installer_keymap'
        comment: 'Default keymap to set for the preseeding'
        value: 'us'

      - name: 'ipxe_boot_path'
        comment: 'Subdirectory with boot configuration files'
        value: 'boot/'

  - name: 'boot.ipxe'
    raw: |
      # iPXE configuration based on https://gist.github.com/robinsmidsrod/2234639

      # Global variables used by all other iPXE scripts
      chain --autofree variables.ipxe ||

      # Boot using a dynamic script if it's specified
      # http://ipxe.org/scripting
      isset ${ipxe_boot_url} && chain --replace --autofree ${ipxe_boot_url} ||

      # Boot <boot-url>/<boot-path>/hostname-<hostname>.ipxe
      # if hostname DHCP variable is set and script is present
      isset ${hostname} && chain --replace --autofree ${ipxe_boot_path}hostname-${hostname}.ipxe ||

      # Boot <boot-url>/<boot-path>/uuid-<UUID>.ipxe
      # if SMBIOS UUID variable is set and script is present
      isset ${uuid} && chain --replace --autofree ${ipxe_boot_path}uuid-${uuid}.ipxe ||

      # Boot <boot-url>/<boot-path>/mac-010203040506.ipxe if script is present
      chain --replace --autofree ${ipxe_boot_path}mac-${mac:hexraw}.ipxe ||

      # Boot <boot-url>/<boot-path>/pci-8086100e.ipxe if one type of
      # PCI Intel adapter is present and script is present
      chain --replace --autofree ${ipxe_boot_path}pci-${pci/${busloc}.0.2}${pci/${busloc}.2.2}.ipxe ||

      # Boot <boot-url>/<boot-path>/chip-82541pi.ipxe if one type of
      # PCI Intel adapter is present and script is present
      chain --replace --autofree ${ipxe_boot_path}chip-${chip}.ipxe ||

      # Boot <boot-url>/menu.ipxe script if all other options have been exhausted
      set post_boot true
      chain --replace --autofree menu.ipxe ||
    state: 'present'

  - name: 'menu.ipxe'
    options:

      - name: 'initialization'
        raw: |
          :start

          chain --autofree variables.ipxe ||

          set space:hex 20:20
          set space ${space:string}

          iseq ${cls} serial && goto ignore_cls ||
          set cls:hex 1b:5b:4a  # ANSI clear screen sequence - "^[[J"
          set cls ${cls:string}
          :ignore_cls

          isset ${arch} && goto skip_arch_detect ||
          cpuid --ext 29 && set arch x86_64 || set arch i386
          iseq ${arch} i386   && set arch5 i586   || set arch5 ${arch}
          iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
          :skip_arch_detect

          isset ${menu} && goto ${menu} ||

          isset ${ip} || dhcp || echo DHCP failed

          isset ${post_boot} || chain --replace --autofree boot.ipxe ||

      - name: 'main-menu-header'
        raw: |
          :main_menu
          isset ${main_menu_cursor} || set main_menu_cursor exit
          clear version
          menu ${main_menu_title} [IP: ${netX/ip}]
          item --gap Default:
          item --key x exit ${space} Boot from hard disk [x]
          item
          item --gap Main menu:

      - name: 'main-menu'
        raw: |
          item --key d debian-installer ${space} Install Debian GNU/Linux on this host [d]
          item

      - name: 'main-menu-footer'
        raw: |
          item netboot_xyz_boot_menu ${space} -> Netboot.xyz Boot Menu
          item sal_boot_menu         ${space} -> SAL Boot Menu
          item rackspace_boot_menu   ${space} -> Rackspace Boot Menu
          item
          item --gap Tools:
          item sysinfo ${space} System info
          item reboot ${space} Reboot
          item shell ${space} iPXE shell

          isset ${menu} && set timeout 0 || set timeout 4000
          choose --timeout ${timeout} --default ${main_menu_cursor} menu || goto cancel
          set main_menu_cursor ${menu}
          set timeout 0
          goto ${menu} ||
          chain ${menu}.ipxe || goto error
          goto main_menu

      - name: 'cancel-shell'
        raw: |
          :cancel
          echo You cancelled the menu, dropping you to a shell

          :shell
          echo Type "exit" to return to menu.
          set menu main_menu
          shell
          goto main_menu

      - name: 'other-boot-menu'
        raw: |
          :sal_boot_menu
          chain http://boot.salstar.sk || goto error
          goto main_menu

          :rackspace_boot_menu
          chain http://boot.rackspace.com/menu.ipxe || goto error
          goto main_menu

          :netboot_xyz_boot_menu
          chain --autofree http://boot.netboot.xyz || goto error
          goto main_menu

      - name: 'reboot-exit-error'
        raw: |
          :reboot
          reboot

          :exit
          echo ${cls}
          exit

          :error
          echo Error occured, press any key to return to menu ...
          prompt
          goto main_menu

          :reload
          echo Reloading menu.ipxe ...
          chain menu.ipxe

      - name: 'sysinfo'
        raw: |
          :sysinfo
          menu System info
          item --gap UUID:
          item mac ${space} ${uuid}
          item --gap MAC:
          item mac ${space} ${netX/mac}
          item --gap IP/mask:
          item ip ${space} ${netX/ip}/${netX/netmask}
          item --gap Gateway:
          item gw ${space} ${netX/gateway}
          item --gap Hostname:
          item hostname ${space} ${hostname}
          item --gap Domain:
          item domain ${space} ${netX/domain}
          item --gap DNS:
          item dns ${space} ${netX/dns}
          item --gap DHCP server:
          item dhcpserver ${space} ${netX/dhcp-server}
          item --gap Next-server:
          item nextserver ${space} ${next-server}
          item --gap Filename:
          item filename ${space} ${netX/filename}
          choose empty ||
          goto main_menu

  - name: 'debian-installer.ipxe'
    raw: |
      chain --autofree variables.ipxe ||

      goto ${menu}

      :debian-installer
      isset ${debian-installer-cursor} || set debian-installer-cursor stable
      set os debian
      set domain ${netX/domain}

      iseq ${manufacturer} Xen && set netcfg netcfg/get_ipaddress=${netX/ip} netcfg/get_netmask=${netX/netmask} netcfg/get_gateway=${netX/gateway} netcfg/get_nameservers=${dns} netcfg/confirm_static=true netcfg/choose_interface=auto netcfg/disable_autoconfig=true ||

      menu Install Debian GNU/Linux / ${arch_a}
      item --gap Select suite:
      item --key e buster ${space} Debian Stable (Buster) [e]
      # Enable this when Debian Bullseye gets an installer
      #item bullseye ${space} Debian Testing (Bullseye)
      item
      item --gap Select release:
      item buster ${space} Debian GNU/Linux 10 (buster)
      item stretch ${space} Debian GNU/Linux 9 (stretch)
      item jessie ${space} Debian GNU/Linux 8 (jessie)
      choose --default ${debian-installer-cursor} version || goto debian_exit
      set debian-installer-cursor ${version}

      set mirrorcfg mirror/suite=${version} mirror/country=manual mirror/http/hostname=${debian_installer_mirror} mirror/http/directory=/${os}

      set boot_params -- quiet

      :deb_boot_type_init
      set type text

      :deb_boot_type
      set dir pxe/linux/debian/${version}/${arch_a}/current

      menu Install Debian GNU/Linux / ${arch_a} / ${version}
      item --gap Select installer mode:
      item text ${space} Text install
      item graphical ${space} Graphical install
      item
      item rescue ${space} Rescue mode
      item
      item expert ${space} Expert install
      item --key b preseed ${space} Preseed install [b]
      item
      item --gap Preseed parameters:
      item config_hostname ${space} Hostname: ${hostname}
      item config_domain ${space} Domain: ${domain}
      item config_preseed ${space} Preseed: ${debian_installer_preseed}
      item config_keymap ${space} Keymap: ${debian_installer_keymap}
      item
      item --gap Installer parameters:
      item config_mirror ${space} Mirror: ${debian_installer_mirror}
      item config_boot_params ${space} Boot: ${boot_params}
      choose --default ${type} type || goto debian-installer

      echo ${cls}
      goto deb_${type}

      :deb_config_mirror
      echo -n Set Debian mirror [${debian_installer_mirror}]: && read change_debian_installer_mirror
      isset ${change_debian_installer_mirror} && set debian_installer_mirror ${change_debian_installer_mirror} || goto deb_boot_type
      clear change_debian_installer_mirror
      set mirrorcfg mirror/suite=${version} mirror/country=manual mirror/http/hostname=${debian_installer_mirror} mirror/http/directory=/${os}
      goto deb_boot_type

      :deb_config_boot_params
      echo -n Edit boot options: && read boot_params
      goto deb_boot_type

      :deb_config_keymap
      echo -n Set keymap [${debian_installer_keymap}]: && read change_debian_installer_keymap
      isset ${change_debian_installer_keymap} && set debian_installer_keymap ${change_debian_installer_keymap} || goto deb_boot_type
      clear change_debian_installer_keymap
      goto deb_boot_type

      :deb_config_hostname
      echo -n Set hostname: [${hostname}]: && read change_hostname
      isset ${change_hostname} && set hostname ${change_hostname} || goto deb_boot_type
      clear change_hostname
      goto deb_boot_type

      :deb_config_domain
      echo -n Set domain [${domain}]: && read change_domain
      isset ${change_domain} && set domain ${change_domain} || goto deb_boot_type
      clear change_domain
      goto deb_boot_type

      :deb_config_preseed
      echo -n Set preseed URL for ${os} ${version} [${debian_installer_preseed}]: && read change_debian_installer_preseed
      isset ${change_debian_installer_preseed} && set debian_installer_preseed ${change_debian_installer_preseed} || goto deb_boot_type
      clear change_debian_installer_preseed
      goto deb_boot_type

      :deb_rescue
      set install_params rescue/enable=true
      goto deb_text

      :deb_expert
      set install_params priority=low
      goto deb_text

      :deb_preseed
      echo -n Set preseed URL for ${os} ${version} [${debian_installer_preseed}]: && read preseedurl || goto deb_boot_type
      isset ${hostname} || goto deb_preseed_get_hostname
      :deb_preseed_has_hostname
      isset ${preseedurl} && set install_params auto=true priority=critical preseed/url=${preseedurl} keymap=${debian_installer_keymap} netcfg/hostname=${hostname} domain=${domain} ||
      set install_params auto=true priority=critical preseed/url=${debian_installer_preseed} keymap=${debian_installer_keymap} netcfg/hostname=${hostname} domain=${domain} ||
      goto deb_text

      :deb_preseed_get_hostname
      echo -n Set hostname [${hostname}]: && read hostname || goto deb_preseed_no_hostname
      isset ${hostname} || goto deb_preseed_no_hostname
      goto deb_preseed_has_hostname

      :deb_preseed_no_hostname
      echo Error: Preseeding requires a valid hostname. Press <Enter> to continue.
      prompt
      goto deb_boot_type

      :deb_text
      set dir ${dir}/debian-installer/${arch_a}
      goto deb_boot

      :deb_graphical
      set dir ${dir}/gtk/debian-installer/${arch_a}
      set install_params vga=788
      goto deb_boot

      :deb_boot
      imgfree
      echo Boot parameters: ${install_params} ${boot_params}
      kernel ${dir}/linux initrd=initrd.gz ${netcfg} ${mirrorcfg} ${install_params} ${boot_params}
      initrd ${dir}/initrd.gz
      boot
      goto debian_exit

      :debian_exit
      set menu main_menu
      chain menu.ipxe
    state: 'present'
ipxe__scripts

The list of the iPXE scripts defined for all hosts in the Ansible inventory.

ipxe__scripts: []
ipxe__group_scripts

The list of the iPXE scripts defined for hosts in a specific Ansible inventory group.

ipxe__group_scripts: []
ipxe__host_scripts

The list of the iPXE scripts defined for specific hosts in the Ansible inventory.

ipxe__host_scripts: []
ipxe__combined_scripts

The variable which combines all of the iPXE script lists and is used in the role tasks and templates.

ipxe__combined_scripts: '{{ ipxe__default_scripts
                            + ipxe__scripts
                            + ipxe__group_scripts
                            + ipxe__host_scripts }}'