Default variables: configuration
some of debops.ipxe default variables have more extensive configuration
than simple strings or lists, here you can find documentation and examples for
them.
ipxe__scripts
The ipxe__*_scripts variables define a list of iPXE scripts stored in the
ipxe__tftp_root directory (by default /srv/tftp/). At boot
time, the iPXE boot loader will download and execute the menu.ipxe
script (this is just a convention controlled by the DHCP server). The script
contains iPXE commands which can be used to define an interactive menu,
chainload other scripts and boot operating systems.
Examples
See the ipxe__default_scripts variable for an example configuration.
Modify an existing default configuration to include additional main menu items
that boot an ISO image over HTTP. When the new option is selected, the iPXE
boot loader will load the new iso-image.ipxe script:
- name: 'menu.ipxe'
options:
- name: 'main-menu'
raw: |
item --key d debian-installer ${space} Install Debian GNU/Linux on this host [d]
item iso-image ${space} Boot custom ISO image
item
- name: 'iso-image.ipxe'
raw: |
set iso-root http://boot.{{ ansible_domain }}/iso/
set iso-img custom-image.iso
initrd ${iso-root}/${iso-img}
chain memdisk iso || goto error
:error
echo Error occurred, press any key to return to menu...
prompt
set menu main_menu
chain menu.ipxe
state: 'present'
Syntax
Each configuration entry defines one iPXE script. The configuration is specified as a YAML dictionary with specific parameters:
nameRequired. Name of the iPXE script. You can include subdirectories in the name (for example
extra/menu.ipxewhich will be created automatically. Entries with the samenameparameter are merged together, this can be used to modify existing entries as needed.commentOptional. A string or a YAML text block with a comment added at the top of the iPXE script.
stateOptional. If not defined or
present, a given iPXE script will be created by the role. Ifabsent, the specified iPXE script will be removed by the role. Ifignore, a given configuration entry will be ignored by the role during its execution. This can be used to activate configuration entries conditionally.rawOptional. A YAML text block that contains the iPXE script, added as-is in the generated file. The
#!ipxeshebang will be added automatically at the top of the file and does not have to be specified. See the iPXE documentation for more details about scripting the bootloader.optionsOptional. An alternative way to define the contents of the generated iPXE script. The
optionsparameters from different configuration entries are merged together and elements of the options list can affect each other. This is a list of YAML dictionaries, each dictionary describes a part of the generated file using specific parameters:nameRequired. An identifier of a given part of the iPXE script. If
rawparameter is specified, thenameparameter is not used otherwise. Ifrawparameter is not specified, thenameparameter is the second element in the script line (seevalueandcommandparameters). By default this defines an iPXE variable name. Option list entries with the samenameparameter are merged together.valueOptional. If
rawparameter is not specified, this parameter defines the third element of the script line. By default this defines a value of a given iPXE variable. You can specify a string or a list which will be concatenated with spaces as separators.commandOptional. If
rawparameter is not specified, this parameter defines the first element of the script line, by defaultsetwhich defines an iPXE variable.rawOptional. YAML text block that contains a section of the iPXE script.
commentOptional. A string or YAML text block with a comment about a given script section.
stateOptional. If not specified or
present, a given script section will be included in the generated file. Ifabsent, a given script section will be removed from the generated file.