Created
May 14, 2018 17:14
-
-
Save xitology/edb5d5d00b3e59a343fc100a366060d3 to your computer and use it in GitHub Desktop.
Fixed generation of /etc/netplan/50-vagrant.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/guests/debian/cap/configure_networks.rb.orig 2018-05-14 12:07:52.356332926 -0500 | |
+++ /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/guests/debian/cap/configure_networks.rb 2018-05-14 12:09:59.085264102 -0500 | |
@@ -37,7 +37,9 @@ | |
ethernets = {}.tap do |e_nets| | |
networks.each do |network| | |
e_config = {}.tap do |entry| | |
- if network[:ip] | |
+ if network[:type] == :dhcp | |
+ entry["dhcp4"] = true | |
+ else | |
mask = network[:netmask] | |
if mask && IPAddr.new(network[:ip]).ipv4? | |
begin | |
@@ -47,8 +49,6 @@ | |
end | |
end | |
entry["addresses"] = [[network[:ip], mask].compact.join("/")] | |
- else | |
- entry["dhcp4"] = true | |
end | |
if network[:gateway] | |
entry["gateway4"] = network[:gateway] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment