Support libvirt built-in TFTP server (#1412)

Adds support for libvirt TFTP server, for netboot environments.

(vide: https://libvirt.org/formatnetwork.html#elementsAddress)
This commit is contained in:
andrzej maczuga
2021-11-30 11:11:52 +01:00
committed by GitHub
parent 9c18a32952
commit 2d53c3a850
3 changed files with 8 additions and 0 deletions

View File

@@ -859,6 +859,7 @@ starts with `libvirt__` string. Here is a list of those options:
* `:libvirt__dhcp_bootp_server` - The server that runs the DHCP server. Used * `:libvirt__dhcp_bootp_server` - The server that runs the DHCP server. Used
only when dhcp is enabled.By default is the same host that runs the DHCP only when dhcp is enabled.By default is the same host that runs the DHCP
server. server.
* `:libvirt__tftp_root` - Path to the root directory served via TFTP.
* `:libvirt__adapter` - Number specifiyng sequence number of interface. * `:libvirt__adapter` - Number specifiyng sequence number of interface.
* `:libvirt__forward_mode` - Specify one of `veryisolated`, `none`, `open`, `nat` * `:libvirt__forward_mode` - Specify one of `veryisolated`, `none`, `open`, `nat`
or `route` options. This option is used only when creating new network. Mode or `route` options. This option is used only when creating new network. Mode

View File

@@ -352,6 +352,10 @@ module VagrantPlugins
@network_dhcp_enabled = false @network_dhcp_enabled = false
end end
if @options[:tftp_root]
@tftp_root = @options[:tftp_root]
end
@network_domain_name = @options[:domain_name] @network_domain_name = @options[:domain_name]
begin begin

View File

@@ -20,6 +20,9 @@
<% if @network_forward_mode != 'veryisolated' %> <% if @network_forward_mode != 'veryisolated' %>
<ip address="<%= @network_address %>" netmask="<%= @network_netmask %>"> <ip address="<%= @network_address %>" netmask="<%= @network_netmask %>">
<% if @tftp_root %>
<tftp root="<%= @tftp_root %>" />
<% end %>
<% if @network_dhcp_enabled %> <% if @network_dhcp_enabled %>
<dhcp> <dhcp>
<range start="<%= @network_range_start %>" end="<%= @network_range_stop %>" /> <range start="<%= @network_range_start %>" end="<%= @network_range_stop %>" />