Add OS variant configuration
- Debian 11 has a different TFTP path than Ubuntu 18.04
Add EFI PXE boot support with conditional
- Conditionally provide different file depending on BIOS or EFI boot
(unsupported on BSD dhcpd implementations)
Fix galaxy metadata
Change-Id: If13d18dbf0455f8e9b27054da6f0eabbb602b71f
diff --git a/templates/dhcpd.conf.j2 b/templates/dhcpd.conf.j2
index 56fafb5..fda60b7 100644
--- a/templates/dhcpd.conf.j2
+++ b/templates/dhcpd.conf.j2
@@ -9,8 +9,9 @@
max-lease-time {{ subnet.max_lease_time | default("480") }};
# option definitions
-{% if ansible_system == "Linux" %}
+{% if ansible_system != "OpenBSD" %}
option rfc3442-classless-static-routes code 121 = array of integer 8;
+option client-arch code 93 = unsigned integer 16; # RFC4578
{% endif %}
{% for subnet, subdata in dhcpd_subnets.items() %}
@@ -41,7 +42,17 @@
{% if subdata.tftpd_server is defined and subdata.tftpd_server %}
# tftpd options
+{% if ansible_system == "OpenBSD" %}
filename "{{ subdata.pxe_filename | default(dhcpd_pxe_filename) }}";
+{% else %}
+ if option client-arch = 00:07 {
+ # amd64 EFI boot
+ filename "{{ subdata.efi_filename | default(dhcpd_efi_filename) }}";
+ } else {
+ # BIOS boot
+ filename "{{ subdata.pxe_filename | default(dhcpd_pxe_filename) }}";
+ }
+{% endif %}
next-server {{ subdata.tftpd_server }};
{% endif %}