From f6acb019b4335f3dd70bd23973b4ec6b80519b13 Mon Sep 17 00:00:00 2001 From: Arthur Outhenin-Chalandre Date: Tue, 1 Aug 2023 15:52:22 +0200 Subject: [PATCH] vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here https://github.com/hashicorp/vagrant/issues/12762#issuecomment-1535957837 to fix it. --- Vagrantfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index a7af6548964..7ba30f32e57 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -207,7 +207,8 @@ Vagrant.configure("2") do |config| end ip = "#{$subnet}.#{i+100}" - node.vm.network :private_network, ip: ip, + node.vm.network :private_network, + :ip => ip, :libvirt__guest_ipv6 => 'yes', :libvirt__ipv6_address => "#{$subnet_ipv6}::#{i+100}", :libvirt__ipv6_prefix => "64", @@ -222,6 +223,14 @@ Vagrant.configure("2") do |config| node.vm.provision "shell", inline: "rm -f /etc/modprobe.d/local.conf" node.vm.provision "shell", inline: "sed -i '/net.ipv6.conf.all.disable_ipv6/d' /etc/sysctl.d/99-sysctl.conf /etc/sysctl.conf" end + # Hack for fedora37/38 to get the IP address of the second interface + if ["fedora37", "fedora38"].include? $os + config.vm.provision "shell", inline: <<-SHELL + nmcli conn modify 'Wired connection 2' ipv4.addresses $(cat /etc/sysconfig/network-scripts/ifcfg-eth1 | grep IPADDR | cut -d "=" -f2) + nmcli conn modify 'Wired connection 2' ipv4.method manual + service NetworkManager restart + SHELL + end # Disable firewalld on oraclelinux/redhat vms if ["oraclelinux","oraclelinux8","rhel7","rhel8","rockylinux8"].include? $os