@@ -47,17 +47,85 @@ downloading (typically) kernel and initrd over HTTP instead of TFTP.
4747
4848## Manifests
4949
50- A manifest represents a machine to be provisioned/served. The behavior of built-in
51- DHCP, TFTP and HTTP server is specific to a manifest, meaning that it varies based
52- on source MAC/IP. Each host may see different content at ` /something ` path.
50+ A manifest represents a machine to be provisioned/served. The behavior of built-in DHCP, TFTP and HTTP server is
51+ specific to a manifest, meaning that it varies based on source MAC/IP. Each host may see different content
52+ at ` /something ` path.
5353
54- Note that this is not a security feature and you should not host any sensitive content. MAC and IPs can be easily
54+ Note that this is not a security feature, and you should not host any sensitive content. MAC and IPs can be easily
5555spoofed. In fact, netbootd includes a convenience feature to spoof source IP for troubleshooting purposes.
5656Append ` ?spoof=<ip-address> ` to HTTP request to see the response for a particular host. There is no TFTP counterpart of
5757this feature.
5858
5959Example manifests are included in the ` examples/ ` directory.
6060
61+ ### Anatomy of a manifest
62+
63+ ``` yaml
64+ ---
65+ # ID can be anything unique, URL-safe, used to identify it for HTTP API
66+ id : ubuntu-1804
67+
68+ # ## DHCP options - used for DHCP responses from netbootd
69+ # IP address with subnet (CIDR) to give out
70+ ipv4 : 192.168.17.101/24
71+ # Hostname (without domain part) (Option 12)
72+ hostname : ubuntu-machine-1804
73+ # Domain part (used for hostname) (Option 15)
74+ domain : test.local
75+ # Lease duration is used as Option 51
76+ # Note that netbootd is a static-assignment server, which does not prevent IP conflicts.
77+ leaseDuration : 1h
78+ # The MAC addresses which map to this manifest
79+ # List multiple for machine with multiple NICs, if not sure which one boots first
80+ mac :
81+ - 00:15:5d:bd:be:15
82+ - aa:bb:cc:dd:ee:fc
83+ # Domain name servers (DNS) in the order of preference (Option 6)
84+ dns :
85+ - 1.2.3.4
86+ - 3.4.5.6
87+ # Routers in the order of preference (Option 3), more than one is rare
88+ router :
89+ - 192.168.17.1
90+ # NTP servers in the order of preference (Option 42), IP address required
91+ ntp :
92+ - 192.168.17.1
93+ # Whether a bundled iPXE bootloader should be served first (before bootFilename).
94+ # When iPXE is loaded, it does DHCP again and netbootd detects its client string
95+ # to break the boot loop and serve bootFilename instead.
96+ ipxe : true
97+ # The name of NBP file name, server over TFTP from "next server",
98+ # which netbootd automatically points to be itself.
99+ # This should map to a "mount" below.
100+ bootFilename : install.ipxe
101+
102+ # Mounts define virtual per-host (per-manifest) paths that are acessible
103+ # over both TFTP and HTTP but only from the IP address of in this manifest.
104+ # Each mount can be either a proxy mount (HTTP/HTTPS proxy) or a content mount (static).
105+ mounts :
106+ - path : /netboot
107+ # When true, all paths starting with this prefix use this mount.
108+ pathIsPrefix : true
109+ # When proxy is defined, these requests are proxied to a HTTP/HTTPS address.
110+ proxy : http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/hwe-netboot/ubuntu-installer/amd64/
111+ # When true, the proxy path defined above gets a suffix to the Path prefix appended to it.
112+ proxyAppendSuffix : true
113+
114+ - path : /install.ipxe
115+ # The templating context provides access to: .LocalIP, .RemoteIP, .HttpBaseUrl and .Manifest.
116+ # Sprig functions are available: masterminds.github.io/sprig
117+ content : |
118+ #!ipxe
119+ # See https://ipxe.org/scripting for iPXE commands/scripting documentation
120+
121+ set base {{ .HttpBaseUrl }}/netboot
122+
123+ {{ $hostnameParts := splitList "." .Manifest.Hostname }}
124+ kernel ${base}/linux gfxpayload=800x600x16,800x600 initrd=initrd.gz auto=true url={{ .HttpBaseUrl.String }}/preseed.txt netcfg/get_ipaddress={{ .Manifest.IPv4.IP }} netcfg/get_netmask={{ .Manifest.IPv4.Netmask }} netcfg/get_gateway={{ first .Manifest.Router }} netcfg/get_nameservers="{{ .Manifest.DNS | join " " }}" netcfg/disable_autoconfig=true hostname={{ first $hostnameParts }} domain={{ rest $hostnameParts | join "." }} DEBCONF_DEBUG=developer
125+ initrd ${base}/initrd.gz
126+ boot
127+ ` ` `
128+
61129## HTTP API
62130
63131In this preview/development version, this HTTP API does not support authentication.
0 commit comments