Antony Messerli f00c6bf215 Replace pxelinux with iPXE support in MNAIO
Adds support for iPXE scripting.  Allows for the
operator to specify a remote iPXE kernel to pull in
newer iPXE kernel features and specify a remote
default iPXE script for customizing the multi node
for other types of deployments.

Switches the installations to use netboot installer kernels
instead of ISO retrival and extraction.

Restructures directory to allow for future multi node configs
instead of just debian based installs.

Change-Id: Ie97f021dbd33ad3d852132b0b2850f54d4e13476
2018-02-07 18:20:00 -06:00

55 lines
1.8 KiB
Django/Jinja

ddns-update-style none;
allow booting;
allow bootp;
log-facility local7;
authoritative;
shared-network all-networks {
{% for dhcp in dhcp_list %}
subnet {{ dhcp.subnet }} netmask {{ dhcp.netmask }} {
option routers {{ dhcp.gateway }};
option domain-name-servers {{ dhcp.dns }};
option subnet-mask {{ dhcp.netmask }};
{% if dhcp.default_lease_time is defined and dhcp.default_lease_time > 0 %}
default-lease-time {{ dhcp.default_lease_time }};
{% else %}
default-lease-time {{ dhcp_default_lease_time }};
{% endif %}
{% if dhcp.max_lease_time is defined and dhcp.max_lease_time > 0 %}
max-lease-time {{ dhcp.max_lease_time }};
{% else %}
max-lease-time {{ dhcp_max_lease_time }};
{% endif %}
{% if dhcp.tftp_server is defined and dhcp.tftp_server|ipaddr %}
next-server {{ dhcp.tftp_server }};
{% elif tftp_server is defined and tftp_server|length > 0 %}
next-server {{ tftp_server }};
{% endif %}
if exists user-class and ( option user-class = "iPXE" ) {
{% if dhcp.ipxe_boot_file is defined and dhcp.ipxe_boot_file|ipaddr %}
filename "{{ dhcp.ipxe_boot_file }}";
{% elif ipxe_boot_file is defined and ipxe_boot_file|length > 0 %}
filename "{{ ipxe_boot_file }}";
{% endif %}
} else {
filename "ipxe.lkrn";
}
}
{% endfor %}
group {
{% for item in groups['pxe_servers'] %}
host {{ hostvars[item]['server_hostname'] }} {
hardware ethernet {{ hostvars[item]['server_mac_address'] | lower }};
fixed-address {{ hostvars[item]['server_vm_fixed_addr'] }};
option host-name "{{ hostvars[item]['server_hostname'] }}";
}
{% endfor %}
}
}