homelab/metal/roles/pxe-server/templates/dhcpd.conf.j2

29 lines
1,006 B
Plaintext
Raw Normal View History

2022-05-12 23:15:51 +02:00
option space pxelinux;
option pxelinux.magic code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
option architecture-type code 93 = unsigned integer 16;
2022-05-15 02:31:41 +02:00
{% for item in groups['metal'] %}
host {{ hostvars[item]['inventory_hostname'] }} {
hardware ethernet {{ hostvars[item]['mac'] }};
option host-name "{{ hostvars[item]['inventory_hostname'] }}";
}
{% endfor %}
2022-05-12 23:15:51 +02:00
subnet {{ subnet }} netmask {{ netmask }} {
option routers {{ gateway }};
2022-05-15 02:31:41 +02:00
option domain-name-servers {{ nameserver }};
option domain-name "{{ domain }}";
range {{ subnet | ansible.utils.ipmath(3) }} {{ subnet | ansible.utils.ipmath(254) }};
2022-05-12 23:15:51 +02:00
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server {{ ansible_default_ipv4.address }};
if option architecture-type = 00:07 {
filename "grubx64.efi";
}
}
}