Fixes to enable iPXE bootloading
This commit is contained in:
parent
3b6eb8bc48
commit
8171c9554d
10
setup/files/boot.ipxe
Normal file
10
setup/files/boot.ipxe
Normal file
@ -0,0 +1,10 @@
|
||||
#!ipxe
|
||||
|
||||
# load the MAC-specific file or fail if it's not found
|
||||
chain --autofree pxelinux.cfg/${mac:hexraw} || goto error_no_config
|
||||
|
||||
:error_no_config
|
||||
echo PXE boot failed. No configuration found for MAC ${mac}
|
||||
echo Press any key to reboot...
|
||||
prompt --timeout 180
|
||||
reboot
|
@ -151,6 +151,8 @@
|
||||
local_action: file name=/etc/ironic state=directory
|
||||
- name: "Place Ironic Config file"
|
||||
local_action: template src=templates/ironic.conf.j2 dest=/etc/ironic/ironic.conf
|
||||
- name: "Place Ironic IPA Agent PXE configuration file"
|
||||
local_action: template src=template/agent_config.template.j2 dest=/etc/ironic/agent_config.template
|
||||
- name: "Copy policy.json to /etc/ironic"
|
||||
local_action: copy src=/opt/stack/ironic/etc/ironic/policy.json dest=/etc/ironic/
|
||||
- name: "Creating Ironic DB Schema"
|
||||
@ -195,6 +197,8 @@
|
||||
- name: "Placing pxelinux.0 (>=14.10)"
|
||||
local_action: copy src=/usr/lib/PXELINUX/pxelinux.0 dest=/tftpboot
|
||||
when: ansible_distribution_version|version_compare('14.10', '>=')
|
||||
- name: "Place boot.ipxe helper script to HTTP root"
|
||||
local_action: copy src=files/boot.ipxe dest=/httpboot/boot.ipxe
|
||||
- name: "Place tftp config file"
|
||||
local_action: copy src=files/xinetd.tftp dest=/etc/xinetd.d/tftp
|
||||
- name: "Copy iPXE image into place"
|
||||
|
12
setup/templates/agent_config.template.j2
Normal file
12
setup/templates/agent_config.template.j2
Normal file
@ -0,0 +1,12 @@
|
||||
#!ipxe
|
||||
|
||||
dhcp
|
||||
|
||||
goto deploy
|
||||
|
||||
:deploy
|
||||
kernel http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080{{ '{{' }} pxe_options.deployment_aki_path {{ '}}' }} ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} text {{ pxe_options.pxe_append_params {{ '}}' }} ipa-api-url={{ '{{' }} pxe_options['ipa-api-url'] {{ '}}' }} ipa-driver-name={{ '{{' }} pxe_options['ipa-driver-name'] {{ '}}' }}
|
||||
|
||||
initrd http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080{{ '{{' }} pxe_options.deployment_ari_path {{ '}}' }}
|
||||
boot
|
||||
|
@ -413,7 +413,7 @@ dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},12h
|
||||
# a TFTP server; either dnsmasq's built in TFTP server or an
|
||||
# external one. (See below for how to enable the TFTP server.)
|
||||
#dhcp-boot=pxelinux.0
|
||||
dhcp-boot=/tftpboot/undionly.kpxe
|
||||
#dhcp-boot=/tftpboot/undionly.kpxe
|
||||
|
||||
# The same as above, but use custom tftp-server instead machine running dnsmasq
|
||||
#dhcp-boot=pxelinux,server.name,192.168.1.100
|
||||
@ -421,9 +421,9 @@ dhcp-boot=/tftpboot/undionly.kpxe
|
||||
# Boot for Etherboot gPXE. The idea is to send two different
|
||||
# filenames, the first loads gPXE, and the second tells gPXE what to
|
||||
# load. The dhcp-match sets the gpxe tag for requests from gPXE.
|
||||
#dhcp-match=set:gpxe,175 # gPXE sends a 175 option.
|
||||
#dhcp-boot=tag:!gpxe,undionly.kpxe
|
||||
#dhcp-boot=mybootimage
|
||||
dhcp-match=set:ipxe,175 # iPXE sends a 175 option.
|
||||
dhcp-boot=tag:!ipxe,undionly.kpxe
|
||||
dhcp-boot=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}/boot.ipxe
|
||||
|
||||
# Encapsulated options for Etherboot gPXE. All the options are
|
||||
# encapsulated within option 175
|
||||
|
@ -473,6 +473,7 @@ enabled_drivers=agent_ipmitool
|
||||
|
||||
# Template file for PXE configuration. (string value)
|
||||
#agent_pxe_config_template=$pybasedir/drivers/modules/agent_config.template
|
||||
agent_pxe_config_template=/etc/ironic/agent_config.template
|
||||
|
||||
# Neutron bootfile DHCP parameter. (string value)
|
||||
#agent_pxe_bootfile_name=pxelinux.0
|
||||
@ -1253,7 +1254,7 @@ dhcp_provider=none
|
||||
#
|
||||
|
||||
# Template file for PXE configuration. (string value)
|
||||
#pxe_config_template=$pybasedir/drivers/modules/pxe_config.template
|
||||
pxe_config_template=$pybasedir/drivers/modules/ipxe_config.template
|
||||
|
||||
# Template file for PXE configuration for UEFI boot loader.
|
||||
# (string value)
|
||||
@ -1287,7 +1288,7 @@ http_root={{ http_boot_folder }}
|
||||
ipxe_enabled=true
|
||||
|
||||
# The path to the main iPXE script file. (string value)
|
||||
ipxe_boot_script=$pybasedir/drivers/modules/ipxe_config.template
|
||||
ipxe_boot_script=$pybasedir/drivers/modules/boot.ipxe
|
||||
|
||||
|
||||
[seamicro]
|
||||
|
@ -43,5 +43,8 @@ http {
|
||||
listen 8080;
|
||||
server_name {{ ansible_hostname }};
|
||||
root {{ http_boot_folder }};
|
||||
location {{ http_boot_folder }}/ {
|
||||
alias {{ http_boot_folder }}/;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user