Merge pull request #727 from hpcng/dnsmasq
added experimental dnsmasq support
This commit is contained in:
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- The primary hostname and warewulf server fqdn are now the canonical name in
|
- The primary hostname and warewulf server fqdn are now the canonical name in
|
||||||
`/etc/hosts`
|
`/etc/hosts`
|
||||||
|
- Added experimental dnsmasq support.
|
||||||
|
|
||||||
## [4.4.0] 2023-01-18
|
## [4.4.0] 2023-01-18
|
||||||
|
|
||||||
|
|||||||
30
overlays/host/dnsmasq.d/ww4-hosts.conf.ww
Normal file
30
overlays/host/dnsmasq.d/ww4-hosts.conf.ww
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# This file was autgenerated by warewulf
|
||||||
|
# Host: {{.BuildHost}}
|
||||||
|
# Time: {{.BuildTime}}
|
||||||
|
# Source {{.BuildSource}}
|
||||||
|
{{ nobackup }}
|
||||||
|
# select the x86 hosts which will get the iXPE binary
|
||||||
|
dhcp-match=set:x86PC,option:client-arch, 7 #EFI x86-64
|
||||||
|
dhcp-match=set:x86PC,option:client-arch, 6 #EFI x86-64
|
||||||
|
dhcp-match=set:x86PC,option:client-arch, 9 #EFI x86-64
|
||||||
|
{{ with (index $.Tftp.IpxeBinaries "00:07" ) }}dhcp-boot=tag:x86PC,"/warewulf/{{ index $.Tftp.IpxeBinaries "00:07" }}"{{ end }}
|
||||||
|
dhcp-no-override
|
||||||
|
# iPXE binary will get the following configuration file
|
||||||
|
dhcp-userclass=set:iPXE,iPXE
|
||||||
|
dhcp-boot=tag:iPXE,"http://{{$.Ipaddr}}:{{$.Warewulf.Port}}/ipxe/${mac:hexhyp}"
|
||||||
|
{{- if $.Tftp.Enabled }}
|
||||||
|
# also act as tftp server
|
||||||
|
tftp-root={{ $.Tftp.TftpRoot }}
|
||||||
|
{{- end }}
|
||||||
|
# define the the range
|
||||||
|
dhcp-range={{$.Dhcp.RangeStart}},{{$.Dhcp.RangeEnd}},{{$.Netmask}},6h
|
||||||
|
{{/* Add all the known hosts */}}
|
||||||
|
{{- range $node := $.AllNodes}} {{/* for each node */}}
|
||||||
|
{{- range $devname, $netdev := $node.NetDevs}} {{/* for each network device on the node */}}
|
||||||
|
{{- if $netdev.Ipaddr.Defined}} {{/* if we have an ip address on this network device */}}
|
||||||
|
{{- if $netdev.Hwaddr.Defined }}
|
||||||
|
dhcp-host={{$netdev.Hwaddr.Get}},set:warewulf,{{$node.Id.Get}},{{$netdev.Ipaddr.Get}},infinite
|
||||||
|
{{- end}} {{/* end if Hwaddr */}}
|
||||||
|
{{- end}} {{/* end if ip */}}
|
||||||
|
{{- end}} {{/* end for each network device */}}
|
||||||
|
{{- end}} {{/* end for each node */}}
|
||||||
17
userdocs/contents/dnsmasq.rst
Normal file
17
userdocs/contents/dnsmasq.rst
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
=======
|
||||||
|
Dnsmasq
|
||||||
|
=======
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
As experimental feature its possible to use `dnsmasq` instead of the ISC `dhcpd` server in combination
|
||||||
|
with a `tFTP` server. The `dnsmasq` service is then acting as `dhcp` and `tftp` server. In order to keep
|
||||||
|
the file `/etc/dnsmasq.d/ww4-hosts.conf` is created and must be included in the main `dnsmasq.conf` via
|
||||||
|
the `conf-dir=/etc/dnsmasq.d` option.
|
||||||
|
|
||||||
|
Addionally in the configuration file `warewulf.conf` in the sections `dhcp` and `tftp` the systemd name of
|
||||||
|
dnsmasq must set for the option `systemd name`.
|
||||||
|
|
||||||
|
After this configuration steps its recommended to rebuild the host overlay with `wwctl overlay build -H` and
|
||||||
|
the the services should be configured with `wwctl configure -a`.
|
||||||
Reference in New Issue
Block a user