Hi,
I have the following definition for a VM:
config.vm.define 'ipa-client-2' do |client_2|
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.memory = "4000"
vb.gui = true
vb.name = 'ipa-client-2'
end
client_2.vm.network "private_network", :name => 'vboxnet1', ip: "172.240.0.4", auto_config: false
client_2.vm.hostname = 'ipa-client-2'
config.vm.provision :salt do |salt|
salt.masterless = true
salt.minion_config = "salt/minion"
salt.run_highstate = true
end
end
When i do vagrant up ipa-client-2, I get:
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
# Update sysconfig
sed -i 's/\(HOSTNAME=\).*/\1ipa-client-2/' /etc/sysconfig/network
# Update DNS
sed -i 's/\(DHCP_HOSTNAME=\).*/\1"ipa-client-2"/' /etc/sysconfig/network-scripts/ifcfg-*
# Set the hostname - use hostnamectl if available
echo 'ipa-client-2' > /etc/hostname
if command -v hostnamectl; then
hostnamectl set-hostname --static 'ipa-client-2'
hostnamectl set-hostname --transient 'ipa-client-2'
else
hostname -F /etc/hostname
fi
# Prepend ourselves to /etc/hosts
grep -w 'ipa-client-2' /etc/hosts || {
sed -i'' '1i 127.0.0.1\tipa-client-2\tipa-client-2' /etc/hosts
}
# Restart network
service network restart
Stdout from the command:
/bin/hostnamectl
Restarting network (via systemctl): [FAILED]
Stderr from the command:
Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.
It turns out it's because of the ifcfg-enp03s interface. It's defined like this:
# Generated by dracut initrd
NAME="enp0s3"
DEVICE="enp0s3"
ONBOOT=yes
NETBOOT=yes
UUID="8924a5b0-f9f4-453b-910d-118a91dac1ec"
IPV6INIT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
If I move it out of the way, it starts working.
Is there something I can do to remove that interface before network restart?
Thanks