khuedoan-homelab/metal/roles/pxe_server/templates/dnsmasq.conf.j2
Bourne-ID f650c894b0
refactor(pxe)!: combine dhcpd and tftpd to dnsmasq (#69)
* Add DNSMasq as an opt-in option

* Default to original

* Remove commented commands

* Remove dhcpd, replaced with dnsmasq

* Remove dhcpd, replaced with dnsmasq

* Move to dnsmasq

* dnsmasq output to stdout

* dnsmasq

* dnsmasq

* Remove unused code, update tag

* Correct title

Co-authored-by: Khue Doan <khuedoan98@gmail.com>

* Remove TFTP

Co-authored-by: Khue Doan <khuedoan98@gmail.com>

* rename to Dnsmasq

Moving to use proxy by default

Co-authored-by: Khue Doan <khuedoan98@gmail.com>

* Rename for consistency

Co-authored-by: Khue Doan <khuedoan98@gmail.com>

* Correct terminology

Co-authored-by: Khue Doan <khuedoan98@gmail.com>

* formatting

Co-authored-by: Khue Doan <khuedoan98@gmail.com>

* Additional logging

* proxy-by-default

* naming consistency

* naming consistency

* Revert Dnsmasq proxy ask

* proxy enabled by default

* naming consistency

* naming consistency

* Formatting

Co-authored-by: Robin Bourne <robin.bourne@onepeloton.com>
Co-authored-by: Khue Doan <khuedoan98@gmail.com>
2022-07-18 01:39:02 +07:00

27 lines
856 B
Django/Jinja

# Disable DNS Server.
port=0
{% if dhcp_proxy == true %}
# We're DHCP proxying on the network of the homelab host
dhcp-range={{ ansible_default_ipv4.address }},proxy
pxe-service=X86-64_EFI, "Boot From Network, (UEFI)", grubx64.efi
{% else %}
# We're DHCP configuring on this range
dhcp-range={{ ansible_default_ipv4.network | ansible.netcommon.ipmath(1) }},{{ ansible_default_ipv4.broadcast | ansible.netcommon.ipmath(-1) }},{{ ansible_default_ipv4.netmask }},12h
dhcp-option=3,{{ ansible_default_ipv4.gateway }}
# Match Arch Types efi x86 and x64
dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-match=set:efi-x86_64,option:client-arch,9
# Set the Boot file based on the tag from above
dhcp-boot=tag:efi-x86_64,grubx64.efi
{% endif %}
# Log DHCP queries to stdout
log-queries
log-dhcp
log-facility=-
# Enable TFTP server
enable-tftp
tftp-root=/tftp